[Qt-interest] Getting QGraphicsView drawItems to yield/restart before completion?

Scott Stafford scott.stafford at gmail.com
Tue Sep 29 20:51:24 CEST 2009


I'm trying to draw a large and complex QGraphicsScene and once I add a lot
of objects, panning and zooming become unpleasantly slow.  (No surprise
here, of course).  I've played with device coordinate caching (helps with
panning to a point) and minimal viewport updates and so on, but eventually
there's just too many objects.  What I'd like to do is draw the items
asynchronously from controlling the UI somehow.  In other words, just like
Google Maps does, I want to pan and zoom and let drawing catch up as fast as
it's able, but to be able to pan again before the items finish drawing.

Is this possible?  I was thinking it would take a rewritten
QGraphicsScene::drawItems function that signals another thread to loop
through the items until told to start over.  Has anyone tried anything like
this?

Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090929/f46d2ad6/attachment.html 


More information about the Qt-interest-old mailing list