[Qgis-developer] Potential performance improvements by using Qt's Graphics View Framework

Jae Sammy jcs at rincon.com
Mon Apr 5 15:29:52 EDT 2010


Marco,

Thanks for this suggestion.  Unfortunately this is not an option for me as I am using 1.0.2 and upgrading represents too big of a risk at this time.

I think this is a good feature addition, but I wonder if we are just re-inventing the wheel here since this feature is already supported in the qgraphicsscene (i.e. each qgraphicsitem notifies the scene of a change to a small subset of the over-all scene).

I am just reading over the graphics view architecture and stumbled on another cool feature which is that multiple views can observe a single scene.  This doesn't work for us since qgsmapcanvas (our qgraphicsview) instantiates his own scene and doesn't allow access to it.  But it would be pretty sweet to be able to pop up multiple views all with completely independent zooms.

Jae C. Sammy

-----Original Message-----
From: Marco Hugentobler [mailto:marco at hugis.net]
Sent: Monday, April 05, 2010 11:42 AM
To: qgis-developer at lists.osgeo.org
Cc: Jae Sammy
Subject: Re: [Qgis-developer] Potential performance improvements by using Qt's Graphics View Framework

Hi Jae

Isn't it possible to use the 'render cache' option to improve speed in such
situations (options->rendering & svg -> use render caching...)? With this
option, every layer stores and reuses its current image if possible (e.g. one
layer changes symbology).

Regards,
Marco


Am Montag, 5. April 2010 19.55:39 schrieb Jae Sammy:
> After trying to optimize my project that loads layers that fall into three
>  categories: * A large number of static rasters (as a background)
>  * A small number of PostGIS layers that change frequently (once every
>  couple of seconds) * A large number of PostGIS layers that change
>  infrequently (once every couple of minutes) I seem to have hit a brick
>  wall.
>
> It appears that QGis boils all of the loaded layers down to a single
>  QGraphicsRectItem (QgsMapCanvasMap).  This means that in my case, I must
>  trigger a repaint on every layer every couple of seconds, yikes!
>
> Qt's native Graphics View Framework
>  (http://doc.trolltech.com/4.4/graphicsview.html) supports just this type
>  of situation and does all the heavy lifting for us.  Why are we not taking
>  advantage of this?
>
> Currently, QgsMapCanvas instantiates a QGraphicsScene but the only item
>  added is our QgsMapCanvasMap.  Instead, it seems like there are
>  performance advantages to be gained by having each layer inherit from
>  QGraphicsItem and implement its own paint().  Then only the layers that
>  need updating can be updated and only the segment of the scene that
>  actually changes (and is in view) will be re-drawn.
>
> -Jae
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>


--
Dr. Marco Hugentobler
HUGIS GmbH
Webereistr. 66
CH-8134 Adliswil
marco at hugis.net
www.hugis.net
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list