diff --git a/.github/workflows/cmake_build.yml b/.github/workflows/cmake_build.yml index b513864c..21c83edd 100644 --- a/.github/workflows/cmake_build.yml +++ b/.github/workflows/cmake_build.yml @@ -37,7 +37,7 @@ jobs: - toolchain: macos-clang os: macos-latest compiler: clang - qt_version: "6.7.1" + qt_version: "6.9.2" modules: "" use_qt6: "ON" @@ -51,7 +51,7 @@ jobs: - toolchain: windows-msvc os: windows-latest compiler: msvc - qt_version: "6.3.0" + qt_version: "6.9.2" modules: "qt5compat" use_qt6: "ON" @@ -62,7 +62,7 @@ jobs: submodules: true - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt_version }} modules: ${{ matrix.modules }} diff --git a/src/GraphicsView.cpp b/src/GraphicsView.cpp index 8842225c..7f72c440 100644 --- a/src/GraphicsView.cpp +++ b/src/GraphicsView.cpp @@ -371,6 +371,14 @@ void GraphicsView::onPasteObjects() void GraphicsView::keyPressEvent(QKeyEvent *event) { switch (event->key()) { +#ifdef Q_OS_MACOS + case Qt::Key_Backspace: +#endif + case Qt::Key_Delete: { + onDeleteSelectedObjects(); + event->accept(); + return; + } case Qt::Key_F2: { BasicGraphicsScene *sc = nodeScene(); diff --git a/test/src/TestUIInteraction.cpp b/test/src/TestUIInteraction.cpp index cca0faeb..5e33a9ce 100644 --- a/test/src/TestUIInteraction.cpp +++ b/test/src/TestUIInteraction.cpp @@ -409,16 +409,17 @@ TEST_CASE("UI Interaction - Keyboard Shortcuts", "[ui][visual]") QSignalSpy deletionSpy(model.get(), &TestGraphModel::nodeDeleted); // Simulate delete key press - QKeyEvent deleteEvent(QEvent::KeyPress, Qt::Key_Delete, Qt::NoModifier); - QApplication::sendEvent(&view, &deleteEvent); + // The physical Delete key on macOS is reported as Backspace +#ifdef Q_OS_MACOS + QTest::keyClick(&view, Qt::Key_Backspace); +#else + QTest::keyClick(&view, Qt::Key_Delete); +#endif UITestHelper::waitForUI(); - // Check if deletion signal was emitted or node was removed - INFO("Node deletion signals emitted: " << deletionSpy.count()); + // Check if node was removed CHECK(deletionSpy.count() >= 0); // Accept any count, implementation may vary - - // (Implementation may vary depending on how delete is handled) - CHECK(true); // Test passed if no crash occurred + CHECK_FALSE(model->nodeExists(nodeId)); } }