QList of QHash values
-
HI all,
I am trying to figure out how to create simple list of QHash values. What I need is
QHash<QString , int> and put it into QList over which I need to iterate.I have tried this
QHash<QString, bool> fileNames;
QList<QHash<QString, bool>> list;fileNames.insert("One", true); fileNames.insert("Two", false); fileNames.insert("Three", true); list << fileNames; for(int i = 0; i < list.size(); i++) qDebug() << list.at(i);But I do not know how to iterate over this list.
-
Hi,
What exact trouble do you have ?
QHash<QString, bool> hash = list.at(index);will get you the object of a specific index. Or do you mean using iterators ? -
Hi,
What exact trouble do you have ?
QHash<QString, bool> hash = list.at(index);will get you the object of a specific index. Or do you mean using iterators ? -
Hope the issue is resolved as suggested. You can move the issue to SOLVED.