diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-08-21 18:34:21 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-26 12:32:17 +0200 |
commit | cc1a604c704f848927b3fa0a97b0a50b0b79d2a4 (patch) | |
tree | 610ece713eba021c8e5a3d248f54a62370e810f8 /src/quick/items/qquickevents_p_p.h | |
parent | 531cf90305ae50920b2e597dd0758fdb82ad88b0 (diff) |
Specify parameters of type registration in class declarations
Using this technique we can automatically register all necessary
revisions and minor versions of a type, using the metaobject system.
This greatly reduces the potential for mistakes and resulting
incompatibilities between versions of imports.
We assume that for each type we need to register all revisions of its
super types and its attached type, and that the revisions match. That
is, if you import version X of type A, you will also get version X of
its attached type and of any super types. As we previously didn't take
these dependencies into account when manually registering the types, a
number of extra revisions are now registered for some types.
Potentially, we can now generate the qmltypes files at compile time,
using moc.
Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents_p_p.h')
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 1a3737091f..1d2ffefc9d 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -84,6 +84,7 @@ class QQuickKeyEvent : public QObject Q_PROPERTY(int count READ count CONSTANT) Q_PROPERTY(quint32 nativeScanCode READ nativeScanCode CONSTANT) Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + QML_ANONYMOUS public: QQuickKeyEvent() @@ -135,6 +136,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickMouseEvent : public QObject Q_PROPERTY(bool isClick READ isClick CONSTANT) Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) Q_PROPERTY(int flags READ flags CONSTANT REVISION 11) + QML_ANONYMOUS public: QQuickMouseEvent() @@ -201,6 +203,7 @@ class QQuickWheelEvent : public QObject Q_PROPERTY(int modifiers READ modifiers CONSTANT) Q_PROPERTY(bool inverted READ inverted CONSTANT) Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + QML_ANONYMOUS public: QQuickWheelEvent() @@ -245,6 +248,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickCloseEvent : public QObject { Q_OBJECT Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + QML_ANONYMOUS public: QQuickCloseEvent() {} @@ -271,6 +275,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickEventPoint : public QObject Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) Q_PROPERTY(QObject *exclusiveGrabber READ exclusiveGrabber WRITE setExclusiveGrabber) + QML_NAMED_ELEMENT(EventPoint) + QML_UNCREATABLE("EventPoint is only available as a member of PointerEvent.") + QML_ADDED_IN_MINOR_VERSION(12) + public: enum State { Pressed = Qt::TouchPointPressed, @@ -362,6 +370,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickEventTouchPoint : public QQuickEventPoint Q_PROPERTY(QSizeF ellipseDiameters READ ellipseDiameters) Q_PROPERTY(QPointingDeviceUniqueId uniqueId READ uniqueId) + QML_NAMED_ELEMENT(EventTouchPoint) + QML_UNCREATABLE("EventTouchPoint is only available as a member of PointerEvent.") + QML_ADDED_IN_MINOR_VERSION(12) + public: QQuickEventTouchPoint(QQuickPointerTouchEvent *parent); @@ -391,6 +403,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerEvent : public QObject Q_PROPERTY(Qt::MouseButtons button READ button CONSTANT) Q_PROPERTY(Qt::MouseButtons buttons READ buttons CONSTANT) + QML_NAMED_ELEMENT(PointerEvent) + QML_UNCREATABLE("PointerEvent is only available as a parameter of several signals in PointerHandler") + QML_ADDED_IN_MINOR_VERSION(12) + public: QQuickPointerEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr) : QObject(parent) @@ -482,6 +498,11 @@ protected: class Q_QUICK_PRIVATE_EXPORT QQuickPointerMouseEvent : public QQuickSinglePointEvent { Q_OBJECT + + QML_NAMED_ELEMENT(PointerMouseEvent) + QML_UNCREATABLE("PointerMouseEvent is only available as a parameter of several signals in PointerHandler") + QML_ADDED_IN_MINOR_VERSION(12) + public: QQuickPointerMouseEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr) : QQuickSinglePointEvent(parent, device) { } @@ -502,6 +523,11 @@ public: class Q_QUICK_PRIVATE_EXPORT QQuickPointerTouchEvent : public QQuickPointerEvent { Q_OBJECT + + QML_NAMED_ELEMENT(PointerTouchEvent) + QML_UNCREATABLE("PointerTouchEvent is only available as a parameter of several signals in PointerHandler") + QML_ADDED_IN_MINOR_VERSION(12) + public: QQuickPointerTouchEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr) : QQuickPointerEvent(parent, device) @@ -623,6 +649,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerDevice : public QObject Q_PROPERTY(QString name READ name CONSTANT) Q_PROPERTY(QPointingDeviceUniqueId uniqueId READ uniqueId CONSTANT) + QML_NAMED_ELEMENT(PointerDevice) + QML_UNCREATABLE("PointerDevice is only available as a property of PointerEvent.") + QML_ADDED_IN_MINOR_VERSION(12) + public: enum DeviceType : qint16 { UnknownDevice = 0x0000, |