Unsolved Force QGraphicsItem to update immediately / wait for update event
-
Hi,
in my application, the geometries of some contents of a QGraphicsItem only get set correctly when the item updates and the paint event is being called for the first time. I need to force that because I need the correct geometry at some point when initializing the item. However,QGraphicsitem::update()
only causes a scheduling of the required update and the paint event gets triggered too late.
How can I force an immediate update or some kind of final geometry computation in a QGraphicsItem? Is there a nice way to do that without using while loops to wait or something like that? -
Hi,
Maybe calling "repaint()" on the Graphics View is what you need.
-
@ollarch nope, unfortunately not, same result as using
QGraphicsItem::update
directly -
@Niagarer said in Force QGraphicsItem to update immediately / wait for update event:
How can I force an immediate update or some kind of final geometry computation in a QGraphicsItem?
You can't since even Qt can't. The update request must be handled through the window manager.