[Qt-interest] structure similar to QMap or QHash
David Boosalis
david.boosalis at gmail.com
Thu Oct 1 17:15:00 CEST 2009
As Paul and Ulf said you can create your own QList and add to it a Hash Table.
For Instance.
class MyList : public QList <MyItem *> {
public:
MyList();
void add(MyItem *); // do not use QList::append() directly
MyItem *findItem(QString key);
.....
private:
QHash<QString, MyItem *> hash; // or however you define your key
};
-David
On Thu, Oct 1, 2009 at 1:39 AM, SALOMEHER at terra.es <SALOMEHER at terra.es> wrote:
> Hi, i need a structure similar to QMap or QHash, with QMap, the items are
> always sorted by key and with QHash, the items are arbitrarily ordered. I
> need a structure that supports the order of insertion.
> Any suggestions?
> Regards.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
More information about the Qt-interest-old
mailing list