Node Editor Tutorial 13: How to implement Selecting Items

preview_player
Показать описание

In this Node Editor tutorial we will do implementation of selecting nodes and edges with PyQt5. We will enable Shift selecting additional items and also Rubber band dragging selection.
Рекомендации по теме
Комментарии
Автор

In LMB press/release handler I add Ctrl modifier if there's Shift modifier. I don't check for item type but it still works correctly.

winandfx
Автор

For me the mousePressEvent for the QGraphicsScene seems to override some stuff from the QGraphicsView. If I start dragging the selection rectangle with the Shift modifier pressed it still deselects my previous selection even after the bug fix you do at 16:00.
I did some debugging and the deselection definitely happens in the mousePressEvent of the QGraphicsScene.
Could this be because I import from PySide2 instead of PyQt5? I thought they were almost identical.

lukasschnorfeil
Автор

there is a bug in your program, when you use the middle mouse button to drag around. Then the white square for the selection does not work anymore.

sebastianhall