[Qgis-developer] STL vs. Qt containers

Martin Dobias wonder.sk at gmail.com
Fri Oct 27 05:42:29 EDT 2006


On 10/27/06, Gary Sherman <sherman at mrcc.com> wrote:
>
> On Oct 26, 2006, at 4:54 AM, Martin Dobias wrote:
>
> > Hi devs,
> >
> > QGIS code uses a mixture of containers (e.g. map, vector, list, set)
> > from standard C++ library and Qt. I'd like to hear your opinions about
> > moving completely to Qt containers (QMap, QVector, ...). Benefit of
> > this would be a "smoother" and more Qt-ish API, possibility to use
> > java-style iterators and more.
> >
> > Overview of the containers:
> > http://doc.trolltech.com/4.2/qt4-tulip.html
> >
> > If noone objects against it, I would change it in the refactoring
> > branch. This will allow making the python bindings easier.
>
> In the past Trolltech stated that their containers were designed to
> provide functionality that might not be available on certain
> platforms. If I'm not mistaken, they also suggested using STL if
> available. Has their position changed? Are the new containers better
> than previous versions and suitable replacements for STL?

I think this has changed.

In Qt3 docs they say (http://doc.trolltech.com/3.3/qt-template-lib.html):
"If a suitable STL implementation is not available on all your target
platforms, the QTL can be used instead."

But on the page about Qt4 containters (called Tulip), they state:
"Qt 4 introduces a new set of containers that supersede both the old
QCollection pointer-based containers and the newer QTL value-based
containers."

For these new containers there's no such note that it's good only for
platforms without STL. I've tried to search for some pages that would
compare Qt4 containers and STL, but with no success.

Martin



More information about the Qgis-developer mailing list