Reputation: 2579
What are the differences between QObjectList
and QList
?
Can they be used interchangeably? If not, can a QList
be cast to a QObjectList
and vice versa?
Upvotes: 2
Views: 1786
Reputation: 1864
QObjectList
is an alias for QList<QObject *>
.
QList<T>
is a template class for lists of type T.
In other words, QList<T>
is a generic class for lists of any type. QObjectList
is a special case of QList, where T is a QObject pointer.
Upvotes: 6
Reputation: 2522
QList
is the generic template version for lists.
QObjectList
is a 'list of pointers to QObject
s' and basically just a typedef on QList<QObject*>
Upvotes: 1