diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-10-12 10:57:39 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-10-12 12:01:20 +0200 |
commit | 528547f5d9d6929f41c94e11591dae36f2794ba2 (patch) | |
tree | 8165b8f6f70dfb4a36caeab871a10d4f4d54114d /src/qmlmodels | |
parent | 0585f0a538c95489f49c5b6075df5bd924ea5b3e (diff) |
Register QAbstractItemModel in QtQml.Models
So that users can assign to QAbstractItemModel* properties in QML.
Pick-to: 5.15
Change-Id: Ifba0da3d777ec47f53b257c39468ed3f5785d40f
Fixes: QTBUG-86428
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlmodels')
-rw-r--r-- | src/qmlmodels/qqmlmodelsmodule_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qmlmodels/qqmlmodelsmodule_p.h b/src/qmlmodels/qqmlmodelsmodule_p.h index 70268f53f2..06b7b1a340 100644 --- a/src/qmlmodels/qqmlmodelsmodule_p.h +++ b/src/qmlmodels/qqmlmodelsmodule_p.h @@ -54,6 +54,7 @@ #include <QtQml/qqml.h> #if QT_CONFIG(itemmodel) +#include <QtCore/qabstractitemmodel.h> #include <QtCore/qitemselectionmodel.h> #endif @@ -69,6 +70,14 @@ struct QItemSelectionModelForeign QML_NAMED_ELEMENT(ItemSelectionModel) QML_ADDED_IN_VERSION(2, 2) }; + +struct QAbstractItemModelForeign +{ + Q_GADGET + QML_FOREIGN(QAbstractItemModel) + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 15) +}; #endif QT_END_NAMESPACE |