qvector Questions

3

Solved

std::vector::size() returns a size_type which is unsigned and usually the same as size_t, e.g. it is 8 bytes on 64bit platforms. In constrast, QVector::size() returns an int which is usually 4 byt...
Bounty asked 28/10, 2014 at 22:47

3

Solved

I am new to c++ and Qt and I am trying to initialize a QVector, which is a class member in a class initialization list like: MyClass::MyClass(QWidget *parent) : QMainWindow(parent) , myVector(QVec...
Zerla asked 5/1, 2014 at 12:24

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

2

Solved

I have a class B that creates an object of a class A and calls a method of the object. a.h #ifndef A_H #define A_H class A { public: A(int); void function(); }; #endif // A_H a.cpp #incl...
Acuff asked 14/1, 2019 at 12:6

1

I can see that that classes are treated as complex objects which are required for calling default constructor: void QVector<T>::defaultConstruct(T *from, T *to) { if (QTypeInfo<T>::is...
Signal asked 27/10, 2015 at 23:38

2

Solved

I'm very confused as to why this isn't working. I must be misunderstanding something key about QVectors... I've created an MCVE to show the issue: #include <QCoreApplication> #include <Q...
Liz asked 1/4, 2018 at 20:48

2

Solved

I have a QVector QVector(48, 64, 31, -2, 14, 5, 7, -3, -1, 13) I want to know how to use Qt mechanism to remove all the elements that are smaller than 0. How do I do this in a simple way? Than...
Beige asked 21/11, 2017 at 11:42

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
1

© 2022 - 2025 — McMap. All rights reserved.