aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-04-07 11:50:39 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-04-28 11:46:03 +0200
commitc2de5643cd4f1b8d8b10e2bb62fdf95f12fdd9e3 (patch)
tree55cfa6610c91315d5ae6cbbf2c961fb2fbfcabd8 /src/qml/types
parent1029b2b9f3d0ff88c0900fbfec2fac873aa6bcd4 (diff)
Register value types declaratively
For now this has the effect of adding them to the .qmltypes files. In the future, the registration shall actually add additional value types you can declare as properties in QML. Change-Id: Ifee5a8ec054f35cc7bd07eb992a136730be68da7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmlmodelindexvaluetype_p.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/types/qqmlmodelindexvaluetype_p.h b/src/qml/types/qqmlmodelindexvaluetype_p.h
index f5b1699574..59c33bf5af 100644
--- a/src/qml/types/qqmlmodelindexvaluetype_p.h
+++ b/src/qml/types/qqmlmodelindexvaluetype_p.h
@@ -53,6 +53,7 @@
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qitemselectionmodel.h>
+#include <QtQml/qqml.h>
QT_BEGIN_NAMESPACE
@@ -67,6 +68,9 @@ struct QQmlModelIndexValueType
Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT FINAL)
Q_PROPERTY(quint64 internalId READ internalId CONSTANT FINAL)
Q_GADGET
+ QML_ANONYMOUS
+ QML_FOREIGN(QModelIndex)
+ QML_ADDED_IN_VERSION(2, 0)
public:
Q_INVOKABLE QString toString() const
@@ -97,6 +101,9 @@ struct QQmlPersistentModelIndexValueType
Q_PROPERTY(QAbstractItemModel *model READ model FINAL)
Q_PROPERTY(quint64 internalId READ internalId FINAL)
Q_GADGET
+ QML_ANONYMOUS
+ QML_FOREIGN(QPersistentModelIndex)
+ QML_ADDED_IN_VERSION(2, 0)
public:
Q_INVOKABLE QString toString() const
@@ -130,6 +137,9 @@ struct QQmlItemSelectionRangeValueType
Q_PROPERTY(bool empty READ isEmpty FINAL)
Q_PROPERTY(QAbstractItemModel *model READ model FINAL)
Q_GADGET
+ QML_ANONYMOUS
+ QML_FOREIGN(QItemSelectionRange)
+ QML_ADDED_IN_VERSION(2, 0)
public:
Q_INVOKABLE QString toString() const;