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 ...
Rosamondrosamund asked 15/12, 2011 at 9:31

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...
Gavriella asked 6/4, 2013 at 10:39

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...
Gomuti asked 23/11, 2014 at 9:44

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...
Homoiousian asked 18/6, 2012 at 20:53

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...
Admeasurement asked 15/1, 2015 at 5:36

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"); ...
Nipissing asked 9/9, 2014 at 15:53

1

Solved

Generally speaking, what is the correct way to deep copy Qt containers? I'm not worried about deep copying the containers recursively, although addressing such would be helpful.
Flitter asked 28/5, 2013 at 19:45

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 ...
Allamerican asked 13/11, 2013 at 21:59

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 ...
Subsequent asked 4/7, 2013 at 7:7

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.
Illuminator asked 23/2, 2012 at 15:17

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...
Sheetfed asked 18/7, 2011 at 8:6

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 ?
Spoor asked 7/1, 2011 at 10:59

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...
Anissaanita asked 19/7, 2010 at 13:41
1

© 2022 - 2024 — McMap. All rights reserved.