[Qt-interest] QHash vs python dictionary

Sean Harmer sean.harmer at maps-technology.com
Tue May 25 11:05:43 CEST 2010


On Tuesday 25 May 2010 10:59:46 M. Bashir Al-Noimi wrote:
> Hi All,
> 
> Currently I'm learning python for web developing. During my study I
> leaned about python dictionary
> <http://en.wikibooks.org/wiki/Python_Programming/Dictionaries> which is
> very flexible data structure where C++ missed it, but I found that QHash
> (and QMap) class is similar to it, is it true?
> 
> 
> On another side, python dictionary defines dynamic dimension (infinite
> child dictionaries or lists) of data where QHash can't (it's C++
> template) so I'm wondering is there any Qt class can deal with dynamic
> dimension of dictionary?

QVariantHash, QVariantMap are what you are looking for:

http://doc.qt.nokia.com/4.7-snapshot/qvariant.html#QVariantHash-typedef
http://doc.qt.nokia.com/4.7-snapshot/qvariant.html#QVariantMap-typedef

Cheers,

Sean



More information about the Qt-interest-old mailing list