I am using QGraphicsScene Qt framework. Inside the scene, I have a QGraphicsItem that the user can select and move. I would like to have an information label where the current x and y coordinates of the current moved selection are displayed (can consist of many elements).
I tried with the changed signal from QGraphicsScene . But it starts before the properties x () and y () of the elements are set to new values. Thus, labels always display the second-last coordinates. If you move your mouse slowly, the display is not very wrong. But with fast movements and sudden stops, the marks are wrong. I need a signal that fires after a scene changes.
I also tried to override the itemChange QGraphicsItem method. But this is the same. He is fired before the change. (The new coordinates are inside the parameters of this method, but I need the new coordinates of all the selected elements at the same time)
I also tried to override the mouseMove events of QGraphicsScene and QGraphicsView , but they are also in front of setting new coordinates.
I did a test: I used a timer so that the labels were updated 100 ms after the signals. Then everything works fine. But the timer is not a solution for me.
What can I do? Make all items immovable and process everything yourself?
eikuh source share