-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
5.15.1, 5.15.2, 5.15.3, 6.1.0
ListModel(QQmlListModel) inherits QAbstractListModel, which inherits QAbstractItemModel.
There are 'data()' methods in QQmlListModel and QAbstractItemModel to check the model data.
But It is only invokable on QAbstractItemModel. The data() method has to be invokable on the child classes.
qabstractitemmodel.h (QAbstractItemModel)
Q_INVOKABLE virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const = 0;
qqmllistmodel_p.h (QQmlListModel)
QVariant data(const QModelIndex &index, int role) const override;
The history was:
- QQmlListModel inherits QAbstractListModel:
- https://git.sailfishos.org/mer-core/qtdeclarative/commit/7daab8039abc32ab5be5706a08cb58905fe0e0b6#37c796b8276181620832233992e5e90b1af4c81d_81_79 - data() in QAbstractItemModel became Q_INVOKABLE:
- https://codereview.qt-project.org/c/qt/qtbase/+/107171 - It seems a mistake not to put an invokable in the child class.
- resulted in
-
QTBUG-93777 More convenient QAIM API for QML
-
- Reported
-