Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cmake_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"

Expand All @@ -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 }}
Expand Down
8 changes: 8 additions & 0 deletions src/GraphicsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
15 changes: 8 additions & 7 deletions test/src/TestUIInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
Loading