Is there any way I can easily use QList<int> as a model for QML Listview?
In my C++ I have this property:
Qt Code:
Q_PROPERTY(QList<int> years READ years CONSTANT)To copy to clipboard, switch view to plain text mode
And was hoping I could just throw that into a ListView. However I get this error when the component is created:
ASSERT: "list.type() != QQmlListAccessor::Instance" in file util\qqmladaptormodel.cpp, line 925
I could create a custom model by extending QAbstractItemModel, but before I do that, is there an easier way to do it? Seems kind overboard for just a list of ints. QQmlListProperty is only for QObject types.
Thanks
Bookmarks