PDA

View Full Version : QGraphicsScene vs QPainter techniques



zotu
19th October 2010, 03:29
What are the advantages or disadvantages using QGraphicsScene over QPainter's draw...() (I mean overriding widget's paintEvent) ?
Which technique is preferred ?

Lykurg
19th October 2010, 06:17
Which technique is preferred ?It depends on the use case. What are you trying to achieve?

zotu
19th October 2010, 09:21
i have many small elements drawn on the widget. i'd like to have the ability to grab those elements with the mouse and move them around on the surface.
at the very first look it seems that QGraphicsScene fits for that purpose.
So I'd like to know the performance cost of using QGraphicsScene technique comparing to doing all logic myself via paintEvent and mouseEvents.

genjix
23rd October 2010, 09:55
I'd go with QGScene too. QPainter is more suited to painting.