Could you give more details, please? any solution?
Could you give more details, please? any solution?
soemthing like -
scaledImage = image.scaled(200,200); // scaled returns a copy which you need to assign. It wont alter the original image.
Hope you get the point![]()
What does it happen when update() is used in PainEvent?
In my case, I've detected that if I don't put Update() image isn't represented in the frame...
Last edited by TeresaML; 25th November 2009 at 11:23.
There is no need to call update() in an Paint Event .
The paintEvent() method is called automatically when:
Your widget is shown for the first time.
After a window has been moved to reveal some part (or all) of the widget.
The window in which the widget lies is restored after being minimized.
The window in which the widget lies is resized.
The user switches from another desktop to the desktop on which the widget's window lies.
What you can do from the paint event is to call a member function which will do the scaling of your image and will return the image in the paint event.
Update() or repaint() are used to generate a paint event.
Calling those function inside the paint event itself can introduce a problem of endless painting recursivity.
Addendum: The update() function never causes recursion according to Qt doc.
Last edited by toutarrive; 10th March 2010 at 12:31.
Bookmarks