Re: How to "flush" display?
update just schedules a paint event, it does not trigger an immediate update.
I don't fully understand your problem... Maybe you can elaborate a bit.
Re: How to "flush" display?
Quote:
Originally Posted by
marcel
update just schedules a paint event, it does not trigger an immediate update.
I don't fully understand your problem... Maybe you can elaborate a bit.
Of course. I just would like to force an immediate execution of paintEvent(), I mean I would like that the paintEvent() be effective immediatement after update().
Re: How to "flush" display?
Quote:
Originally Posted by
Caius Aérobus
I just would like to force an immediate execution of paintEvent(), I mean I would like that the paintEvent() be effective immediatement after update().
You can use QWidget::repaint() instead.
Re: How to "flush" display?
Quote:
Originally Posted by
jacek
I did it... but it does not change anything!
Re: How to "flush" display?
repaint() does not work on all platforms. You can only paint to a widget (including to an item in a scene rendered by a QGraphicsView widget) during a paint event.
I don't understand your original problem though. Why would you want to paint an item immediately after painting it? The user would not be able to see the first paint because it would happen so fast. Why not just paint the item once? In your mouseReleaseEvent() you can set an appropriate state on the item and call update(). Then in paintEvent() drw the item according to the state you set.
Re: How to "flush" display?
Quote:
Originally Posted by
Brandybuck
repaint() does not work on all platforms. You can only paint to a widget (including to an item in a scene rendered by a QGraphicsView widget) during a paint event.
I don't understand your original problem though. Why would you want to paint an item immediately after painting it? The user would not be able to see the first paint because it would happen so fast. Why not just paint the item once? In your mouseReleaseEvent() you can set an appropriate state on the item and call update(). Then in paintEvent() drw the item according to the state you set.
That's what I did but the paintEvent() is not processed until I put a window on top of my application window and show it again.
Re: How to "flush" display?
I have fixed the problem: it is a Mac issue because the same code compiled on Linux works well.