Dragging multiple Qt4 QGraphicsItems MUCH slower than Qt3 QCanvasItems
When selecting and dragging about 20 QGraphicsItems (with 40x40 pixel pixmaps), move updates are VERY slow. Doing the same with Qt3 Compatibility Library QCanvasItems there is NO delay (all in the same build). We're using Qt 4.3.3 on Windows and Solaris.
I've tried refraining from setting antialiasing and SmoothPixmapTranform render hints -- no noticeable difference in terms of speed. (But the effect of doing so is apparent in terms of graphics quality).
We're not yet ready to build with newer versions of Qt (e.g. Qt 4.4) -- that's coming. Has this been addressed, or is there anything we can do about this?
Re: Dragging multiple Qt4 QGraphicsItems MUCH slower than Qt3 QCanvasItems
Strange that something in Qt3 works faster than in Qt4 !
still there are improvements in Qt 4.4 with introduction of cache mode for graphicsitems.
And in Qt 4.5 there are many improvements
You can refer this link too
Yet, am not sure why ur code in 4.3 is running slower than Qt 3 :(
Re: Dragging multiple Qt4 QGraphicsItems MUCH slower than Qt3 QCanvasItems
Try profiling the application to see what causes the slowdown. Without any details on the situation we can't help you in any way and I doubt just upgrading to Qt 4.4 or 4.5 would help significantly. I can assure you I can drag many GV items without slowdowns.
Re: Dragging multiple Qt4 QGraphicsItems MUCH slower than Qt3 QCanvasItems
... Thanks, yes. We will try profiling with Purify.
We tried two things (still in Qt 4.3): (1) A test with just an empty QGraphicsPixmapItem subclass without any processing on events (i.e. no virtual method re-implementations), and also (2) recoding to "composite" two child QGraphicsItems (a Pixmap item and a Text item) instead of doing our own drawing. Both helped only a little. (About the same. Very slow drag-moving with twenty 40x40 icons items selected, even without text drawing). So maybe we're doing something to the QGraphicsScene or QGraphicsView which is bad? We should profile.
Here's an article discussing basically this problem back in 2007 with Qt 4.2, with some suggestions ... Qt: Improving QGraphicsView Performance ..
http://thesmithfam.org/blog/2007/02/03/qt-improving-qgraphicsview-performance/
The new White Paper from Nokia ... Ensuring Maximum Performance with Qt .. (free download with registration) .. makes Qt 4.5 look VERY promising. I can't wait to give that a try. http://www.qtsoftware.com/forms/whitepapers/reg-whitepaper-performance
Re: Dragging multiple Qt4 QGraphicsItems MUCH slower than Qt3 QCanvasItems
Is it possible for you to share some of the code with us? Especially the implementation of items you use.