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?"