[Qgis-developer] Utilising QGraphicsScene in a first-class fashion for QgsMapCanvas

Martin Dobias wonder.sk at gmail.com
Sun Apr 15 17:33:02 EDT 2007

On 4/13/07, Brendan Morley <morb at beagle.com.au> wrote:
> > Important question is the performance when representing features as
> > QGraphicsItems. Personally I'm in favour to use this implementation
> > but definitely we should find out first if this won't eat too much
> > processor time (and memory).
> I can submit the code as a patch in email or as a new subversion branch;
> then you can contrast and compare to your heart's content.

I'll check the code later, these days I'm quite busy...

> You can probably tell that my bias is to favour programming agility over
> runtime capacity, especially if it's only a minor tradeoff.
> You can also check out the Qt demo "chip".

I know that chip demo, it's nice.
Of course if the tradeoff is minor, I'm interested.

> > I'm not sure whether QgsMapToPixel should be obsoleted - when you're
> > using only core libraries (no map canvas) there should be a simple way
> > how to convert between the coordinates when doing something with
> > rendered map.
> What use-case would necessitate only the core library?
> I remember a conversation maybe 6-12 months ago where we may have wanted
> to render a map scene directly to an image file.
> In the new paradigm, you would add your items to the QGraphicsScene and
> then call QGraphicsScene.render() or QGraphicsView.render() (probably
> more the latter).

Currently you can create an application which uses QGIS core library
and you don't need X11. QGraphicsView AFAIK needs running X server so
any rendering couldn't be done without X server.

My concern is that QGIS core library should provide enough
functionality to develop server side GIS/mapping applications. The
need for a running X server would degrade the library greatly.

> > Perspective transformations look very good. I'm currently developing a
> > simple navigation and routing application (as a school project) based
> > on QGIS libs + python and this looks like a must have feature :-)
> Well we'll need to prepare the foundations then won't we? (-:

Actually the transformations can be done also with the rendered map,
though that won't be much eyecandy.

As discussed on IRC, my opinion is that when doing such a big changes,
that new canvas design should be implemented as an alternative (and
possible replacement) for current canvas and not as an immediate


More information about the Qgis-developer mailing list