[Qt-interest] structure similar to QMap or QHash
SALOMEHER at terra.es
SALOMEHER at terra.es
Fri Oct 2 10:06:31 CEST 2009
Thanks for your suggestions. I will use a QList as follows:
QList<QPair<int, int> > list;
Regards.
----Mensaje original----
De: david.boosalis at gmail.com
Fecha: 01/10/2009 17:15
Para: <SALOMEHER at terra.es>
CC: <qt-interest at trolltech.com>
Asunto: Re: [Qt-interest] structure similar to QMap or QHash
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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091002/c87e4f9f/attachment.html
More information about the Qt-interest-old
mailing list