Skip to content Skip to sidebar Skip to footer

How To Provide Data From PySide QAbstractItemModel Subclass To QML ListView?

I have an app I'm writing in PySide that has a QML UI. I have subclassed QAbstractListModel in Python: class MyModel(QtCore.QAbstractListModel): def __init__(self, parent=None)

Solution 1:

You need to set the role names for the model to be able to access the data in QML;

http://doc.qt.io/archives/qt-4.7/qabstractitemmodel.html#setRoleNames


Post a Comment for "How To Provide Data From PySide QAbstractItemModel Subclass To QML ListView?"