Unsolved Expose QAbstractItemModel as a property?
-
Is it possible to expose a QAbstractItemModel which is a member of a Q_OBJECT as a Q_PROPERTY to qml? If so, what is the right object type?
-
@maxwell31 said in Expose QAbstractItemModel as a property?:
Is it possible to expose a QAbstractItemModel which is a member of a Q_OBJECT as a Q_PROPERTY to qml?
Yes.
If so, what is the right object type?
QObject *
-
The right type to expose it is
QAbstractItemModel*
or a pointer to your own subclass type if you exposed more functionality.You might have to call
qmlRegisterType<T>()
(the one with no parameters is enough here).