qmap Questions
11
Solved
I've a QMap object and I am trying to write its content to a file.
QMap<QString, QString> extensions;
//..
for(auto e : extensions)
{
fout << e.first << "," << e.second ...
2
Solved
I have a QMap consist of pointers to class objects, allocated using new. I need to delete all these pointers. What is the proper way of doing this with QMap ? I can do it this way:
QList<ClassN...
2
Solved
I would like to use QMultiMap (which is derived from QMap) to store key/value pairs. Since I can have keys multiple times I would prefer to use QMultiMap.
Assume I would insert the following pairs...
1
Solved
I am using Qt5 on Windows 7.
In my current app, I have the following (simplified here):
QMap<int, QString> map;
int _WorkerThread_(int index)
{
QString new_element = "whatever";
...
...
Larcher asked 29/6, 2016 at 12:12
5
Solved
#include <QtCore/QCoreApplication>
#include <QVariant>
#include <QtDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QVariantMap map;
map["foo"] = QVar...
1
Solved
Edit 7 :
After quite a bit of help, I've been able to get a map that is getting close to the results I need. But I still need to have the state boundaries come through on the map, but I can't fig...
3
Solved
I need to know in QMap second value there is. Functions like first() and last() are useless. Do i have to use iterator, some kind of loop?
QMap<int, QString> map;
map.insert(1, "Mario");
...
1
Solved
2
Solved
I often see code like:
if(myQMap.contains("my key")){
myValue = myQMap["my key"];
}
which theoretically performs two look-up's in the QMap.
My first reaction is that it should be replaced by ...
3
Solved
I couldn't find a way to set a custom comparator function for QMap, like I can for std::map (the typename _Compare = std::less<_Key> part of its template arguments).
Does QMap have a way to ...
2
Solved
I am trying to prevent naked pointers, to prevent memory leaking etc. I also want to map int to INuiSensor*. Since I am also using Qt I tried to use QMap<int, std::unique_ptr<INuiSensor>&g...
Unknit asked 28/4, 2013 at 12:58
1
Solved
I wounder why does QMap realised over skiplist data-structure and not rb-tree?
There is very interesting SO thread about concurrency data-structs and skip-list benefits over rb-tree, pros and cons....
Antiicer asked 1/10, 2012 at 10:28
1
How can I expose QMap from C++ to QML?
Using QList I can use QDeclarativeListProperty.
2
Solved
I was wondering for how long the reference to a value inside a Qt container, especially a QHash or a QMap is valid. By valid I mean if it is guaranteed to still point to the correct location inside...
Dyspeptic asked 30/10, 2011 at 19:5
3
Solved
I am trying find nearest RGB value in QMap (I know it probably should be HSV, but that is not the problem). Here is what I got so far:
it = images_map.find(current_rgb);
if(it != images_map.beg...
2
Solved
What should i use between QMap::insertMulti and QMultiMap to handle :
2 -> abc
2 -> def
3 -> ghi
3 -> jkl
What's the difference enter the 2 solutions ?
2
Solved
QVariant (needed for QSettings class) supports creation from QMap<QString, QVariant>
But trying to initialise something like this:
QMap<QString, QVariant(QMap<QString, QVariant>)&g...
1
© 2022 - 2024 — McMap. All rights reserved.