you can make a slot and connect the selectionChanged
signals of both GraphicsScenes to it. in the slot, you can check the selected items.
since the slot is only triggered when the selection of one of the connected GraphicsScenes has changed, you have no infinite loop and your programm will not be blocked.
Qt wait for user to select items in QGraphicsScene
-
31-05-2022 - |
Вопрос
So I have 2 QGraphicsScene
s with QGraphicsView
s in my ui. In those QGraphicScene
s are QGraphicsItem
s, now I want to make my program wait to let the user select one QGraphicsItem
om each Scene, but how do I do this?
I've tried things like:
while(scene->selectedItems().length()<1 || bordScene->selectedItems().length()<1)
;
But this will just cause the program to go in an infinite loop and the user still won't be able to select items.
This is probably a pretty simple question but I can't seem to find a simple solution
Решение
Не связан с StackOverflow