[Qt-interest] how to iterate multi-dimensional QMap?
Andre Somers
andre at familiesomers.nl
Wed Aug 11 20:46:31 CEST 2010
Op 11-8-2010 15:28, franki schreef:
> Hi all,
>
> I have two dimensional QMap and a QMapIterator
>
> QMap<QString,QMap<QString,QString> > wdata;
> QMapIterator<QString, QMap<QString,QString> > it(wdata);
>
> When I'm trying to compile it, gives me error:
> error: ‘wdata’ is not a type
>
> I'm just looking for a way to iterate through this map.
> I was searching the net, but no luck
>
What sometimes helps, at least with readability, is using typedefs.
typedef QMap<QString, QMap<QString, QString> > TwoDStringMap;
TwoDStringMap wdata;
QMapIterator<TwoDStringMap> it(wdata);
Or something like that...
André
More information about the Qt-interest-old
mailing list