Problem with QMap
-
Ok. But what does it happen when the function is contains(..key..)?
@cristiano.narcisi
it looks like outside of constructor the key list is no more.
i wanted to see if it says
zero for par. -
@cristiano.narcisi
it looks like outside of constructor the key list is no more.
i wanted to see if it says
zero for par.Ok but it is very strange. I give you another information: i can view all the key-value pair stored into the par variable using the watches of the editor!!!!
-
Ok but it is very strange. I give you another information: i can view all the key-value pair stored into the par variable using the watches of the editor!!!!
@cristiano.narcisi
OK ?!?! That also pretty strange.what about size inside and out?
-
@cristiano.narcisi
OK ?!?! That also pretty strange.what about size inside and out?
Size outside the ctor is correct. It is 5!!!
-
Using the iteartor i can view all the values stored in the QMap .... Probably i don't understand something of very important about how QMap acceses the data.
//your code hereQMap<const char *, QString>::ConstIterator ii; for( ii = par.constBegin(); ii != par.constEnd(); ++ii ) qDebug() << ii.key() << " = " << ii.value();```
-
Size outside the ctor is correct. It is 5!!!
@cristiano.narcisi
ok ?!?I think you should try dump the list using par to see if key corruption
else there is no reason contains should not work. -
@cristiano.narcisi
ok ?!?I think you should try dump the list using par to see if key corruption
else there is no reason contains should not work.Probably i have understood why i can retry the key. The problem is that i am using
QMap< const char *, QString>
This means that the key is a POINTER and not the text !!!
I have replaced the QMap template with
QMap< QString, QString>
Now the key is an ITEM and not a POINTER and i can find all the keys and the value stored within the QMap.
Sorry for bothering you
Thanks for hepling me
Regards
Cristiano Narcisi
-
@cristiano.narcisi said:
QMap
Hi
can you show the cpp of the constructor also?
How you add the items.Inheriting from Qmap is a bit funky for me as with STL that was normally
not super idea. but i dont know with QList. :) -
Probably i have understood why i can retry the key. The problem is that i am using
QMap< const char *, QString>
This means that the key is a POINTER and not the text !!!
I have replaced the QMap template with
QMap< QString, QString>
Now the key is an ITEM and not a POINTER and i can find all the keys and the value stored within the QMap.
Sorry for bothering you
Thanks for hepling me
Regards
Cristiano Narcisi
@cristiano.narcisi
ok so
#define MAC_KEY "mac"
used as key did funky stuff?good found :)
-
@cristiano.narcisi
ok so
#define MAC_KEY "mac"
used as key did funky stuff?good found :)