Skip to content

Commit 1fea876

Browse files
committed
Workaround fix for crashes when deleting links
1 parent e63124c commit 1fea876

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

NodalScene.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ NodalScene::NodalScene(QObject* parent)
5151
// Create the output, that is a unique and non-removable component
5252
createNode("Output", 100.0);
5353
m_undoStack->clear();
54+
55+
// Disabling BSP to avoid crashing when removing link items in the scene
56+
// see: https://forum.qt.io/topic/71316/qgraphicsscenefinditembsptreevisitor-visit-crashes-due-to-an-obsolete-paintevent-after-qgraphicsscene-removeitem/21
57+
// (TL;DR: Removing item in the scene doesn't remove properly the item in the BSP tree)
58+
// TODO: find a better fix to get better perf with lot of items in the scene
59+
setItemIndexMethod(QGraphicsScene::ItemIndexMethod::NoIndex);
5460
}
5561

5662
NodalScene::~NodalScene()

0 commit comments

Comments
 (0)