Unsolved QGraphicsItem paint event called continually during QWidget::event loop
-
We have a palette of icons in a dock widget that the user can add into the scene, copy, paste and delete. Each graphics item has a proxy widget that holds properties for the item. The items are rectangles and lines that connect between them so that moving a rectangle should move the lines that are connected to it. I want the items to update at a reasonable event, for example a mouse release event, instead of repeatedly like they doing now which is causing some lag. Basically I want to install an event filter, but am first trying to understand why all QMainWindow events are triggering a graphics item paint.
-
By proxy do you mean you have QProxyGraphicsProxyWidget ?
-
yes that's it
-
How many are they at once on your scene ?
-
There's no limit to how many can be in the scene and the scenes are likely to get complicated . Most likely there will be between ~10 and ~50 items at a time.
-
Are you still experiencing that if you avoid the proxy widgets ?
-
Yes we are
-
This post is deleted! -
Is the code accessible somewhere to be tested ?
-
Hi sorry for the late response. We figured out the problem. Within the paint function of the rectangle we were updating the line and this was causing an infinite paint loop. Thank you for your help!
-
Glad you found out and thanks for sharing !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)