I have a multimap with QVariant as key, but it's not working with QByteArray.
The funcion map.values("\xc2\x39\xc7\xe1") is returning all the values of the map.
This is a small example:
#include <QCoreApplication>
#include <QMultiMap>
#include <QVariant>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QMultiMap<QVariant, QString> map;
QByteArray b1("\xc1\x39\xc7\xe1");
QByteArray b2("\xc1\x39\xc7\xe2");
map.insert(QVariant(b1), "TEST1");
map.insert(QVariant(b2), "TEST2");
QStringList values = map.values(QByteArray("\xc1\x39\xc7\xe1"));
return a.exec();
}
I tried also using a QMap to see what happens and it adds only an element to the map.
Can someone explain me this behavior?
What am I doing wrong?