Hello and good morning together,
I have two questions concerning QVector and its usage. I have an own custom class. It is necessary to use QVector<QSharedPointer<Class*>>
or does it suffice to directly add instances to QVector
like QVector<Class*>>
. I read that QVector
already uses a shared pointer internally contrary std vector. It is bad practice to append instance pointer directly?
Next, I want to have a subset of QVector
with selected elements. What is good practice to do that using QVector>?
__________
|QVector |
| _______|
| |QVector|
|__|_______|