qlist Questions

2

Solved

I have two QLists for which I need to determine the intersection (in this specific case, two QStringLists, but I would assume that this would apply to every container so long as T implements operat...
Tesstessa asked 9/7, 2013 at 22:6

4

Solved

I'm new to Qt and trying to learn the idioms. The foreach documentation says: Qt automatically takes a copy of the container when it enters a foreach loop. If you modify the container as you ar...
Neville asked 23/12, 2011 at 8:22

3

Solved

I have a QList consist of QVector3D. A QVector3D represents a vertex or a point. This List holds also all vertices of a STL-File. The problem is that a vertex exist multiple times in the list. In n...
River asked 13/8, 2013 at 8:20

5

Solved

I am trying to debug some Qt containers in XCode and the results I get back from GDB are not useful: print l1 $1 = (QSharedPointer<QList<SNAPSHOT> > &) @0x102780650: { <QtShar...
Gosh asked 24/6, 2012 at 2:16

8

Solved

My question is basically when to choose QVector and when to choose QList as your Qt container. What I already know: Qt docs: QList class For most purposes, QList is the right class to use. It...
Humankind asked 9/11, 2015 at 12:45

3

Solved

I want to save a QList<int> to my QSettings without looping through it. I know that I could use writeArray() and a loop to save all items or to write the QList to a QByteArray and save this b...
Boito asked 16/3, 2010 at 8:20

2

Solved

What is the right way to initialize QList? I want to make this code shorter: QSplitter splitter; QList<int> list; list.append(1); list.append(1); splitter.setSizes(list); But when I use in...
Hodges asked 25/9, 2013 at 7:12

9

Solved

If I've got a list of things in C++, how do I expose that to QML (in Qt5 / QtQuick 2)? It seems like QML can only understand QObject-derived classes, which is an issue because QObjects can't be put...
Chickabiddy asked 11/1, 2013 at 21:52

2

Solved

I'm trying to pass a 2d QList as a Q_PROPERTY into QML, however, inside QML and i am unable to actually access any of the information. some code: c++: the q_property get populated by a q_invokabl...
Libidinous asked 21/8, 2017 at 20:44

2

I have this simple class: class SomeClass { QString key; QString someData; int otherField; public: QString getKey() { return key }; }; And I have this list: QList<SomeClass*> myList;...
Signification asked 13/8, 2017 at 7:51

1

Solved

I am trying to create a QList of a polymorphic type that still uses Qt's implicit sharing. My specific use case is passing items held in a QList to QtConcurrent::mapped. The items all descend fro...
Granth asked 16/6, 2017 at 15:44

1

Solved

I'm trying to iterate through two different directories. The two directories are on the same root /. void MainWindow::loadPlugins() { pluginsDir = QDir(qApp -> applicationDirPath()); #if def...
Hysteresis asked 15/6, 2017 at 4:28

1

Solved

QList::fromStdList allows you to create QList from std::list. But how to create QList from std::vector? Of course, aside from manual looping: QList<T> myList; myList.reserve(vector.size());...
Cyanamide asked 8/6, 2017 at 11:33

4

Solved

I need to insert pointers of classes (inherited from QObject) into a QList. I know that the following syntax can be used: .h QList<MyObject*> list; .cpp list.append(new MyObject("first",...
Manumit asked 15/7, 2010 at 10:14

4

Solved

I just noticed that QList doesn't have a resize method, while QVector, for example, has one. Why is this? And is there an equivalent function?
Ragg asked 4/2, 2013 at 8:47

2

I am trying to sort my QList based on a QDateTime but I get the following error: must use '.*' or '->*' to call pointer-to-member function in 'lessThan (...)', e.g. '(... ->* lessThan) (...)...
Scintilla asked 25/11, 2015 at 9:52

1

Solved

The Qt container classes QList<T>, QVector<T> etc. require their element types to be copyable. Since C++11, the STL containers require their element type to be copyable or movable only....
Carpal asked 15/9, 2015 at 11:18

3

Solved

In a class I'm working on, I am juggling several QLists. I have heard that Qt tries not to make deep copies of lists whenever possible. From what I understand, that means that no deep copy happens ...
Beep asked 28/7, 2011 at 21:48

2

Solved

I'm trying to create a list of objects using QList, but I'm getting an error when I try to add to the list. It works if I use QString as the object, but not if I use TestClass. updated main.cpp th...
Berte asked 12/8, 2014 at 18:43

3

Solved

I have a Qlist full of objects created dynamically. Prior to terminating my program, I call myqlist.clear() My question is: does this also delete (free) the objects which are contained in the list...
Blodget asked 27/1, 2014 at 16:35

3

Solved

Is there a way to get the min and the max of a QList in Qt without using any iterator ? Here is the code using iterator : QList<double>::iterator min = std::min_element(listVal.begin(), lis...
Somaliland asked 18/2, 2015 at 9:17

4

Solved

Has anyone encountered a maximum size for QList? I have a QList of pointers to my objects and have found that it silently throws an error when it reaches the 268,435,455th item, which is exactly 2...
Tannenberg asked 24/11, 2014 at 23:39

2

Solved

How would I go about using the setHorizontalHeaderLabels property of my tableWidget to specify names for my columns as opposed to numbers? I want to keep my rows as numbers, but change my columns t...
Sitnik asked 30/5, 2012 at 15:53

2

Solved

I'm wondering what the difference between the functions QList::length() and QList::count() really is. The docs say: int QList::length() const This function is identical to count(). int QList::cou...
Enrapture asked 17/9, 2014 at 14:41

1

Solved

although I've been helped countless times by other questions/answers here, this is my first question here, so don't be too harsh on me! :) I've been learning QT/C++ and let's assume I have somethi...
Nasia asked 18/8, 2014 at 16:32

© 2022 - 2024 — McMap. All rights reserved.