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...
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...
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...
8
Solved
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...
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...
9
Solved
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...
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
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",...
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?
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) (...)...
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 ...
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...
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...
4
Solved
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...
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
1 Next >
© 2022 - 2024 — McMap. All rights reserved.