Kay, so taht's not possible. Using QMap with a dummy .data field seems a little too messy to me, using QList<> as suggested by wysota is ofcourse possible.
Thanks all, guess i'll go with that.
Lil follow-up problem:
I can only get const References to the items contained in the list. Why?
MyClass& LeFunc(...)
{
QList<MyClass> list;
...
Q_FOREACH(MyClass& i, list) //error C2440: 'initializing' : cannot convert from 'const MyClass' to 'MyClass &'
{
if(i.thisisit())
return i;
}
...
}
MyClass& LeFunc(...)
{
QList<MyClass> list;
...
Q_FOREACH(MyClass& i, list) //error C2440: 'initializing' : cannot convert from 'const MyClass' to 'MyClass &'
{
if(i.thisisit())
return i;
}
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks