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/util/qquickanimator_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/util/qquickanimator_p.h')
-rw-r--r-- | src/quick/util/qquickanimator_p.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/quick/util/qquickanimator_p.h b/src/quick/util/qquickanimator_p.h index 511cecda7f..9f7aaafcb0 100644 --- a/src/quick/util/qquickanimator_p.h +++ b/src/quick/util/qquickanimator_p.h @@ -69,6 +69,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickAnimator : public QQuickAbstractAnimation Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged) Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged) + QML_NAMED_ELEMENT(Animator) + QML_ADDED_IN_MINOR_VERSION(2) + QML_UNCREATABLE("Animator is an abstract class") + public: QQuickItem *targetItem() const; void setTargetItem(QQuickItem *target); @@ -109,6 +113,8 @@ class QQuickScaleAnimatorPrivate; class Q_QUICK_PRIVATE_EXPORT QQuickScaleAnimator : public QQuickAnimator { Q_OBJECT + QML_NAMED_ELEMENT(ScaleAnimator) + QML_ADDED_IN_MINOR_VERSION(2) public: QQuickScaleAnimator(QObject *parent = nullptr); protected: @@ -119,6 +125,8 @@ protected: class Q_QUICK_PRIVATE_EXPORT QQuickXAnimator : public QQuickAnimator { Q_OBJECT + QML_NAMED_ELEMENT(XAnimator) + QML_ADDED_IN_MINOR_VERSION(2) public: QQuickXAnimator(QObject *parent = nullptr); protected: @@ -129,6 +137,8 @@ protected: class Q_QUICK_PRIVATE_EXPORT QQuickYAnimator : public QQuickAnimator { Q_OBJECT + QML_NAMED_ELEMENT(YAnimator) + QML_ADDED_IN_MINOR_VERSION(2) public: QQuickYAnimator(QObject *parent = nullptr); protected: @@ -139,6 +149,8 @@ protected: class Q_QUICK_PRIVATE_EXPORT QQuickOpacityAnimator : public QQuickAnimator { Q_OBJECT + QML_NAMED_ELEMENT(OpacityAnimator) + QML_ADDED_IN_MINOR_VERSION(2) public: QQuickOpacityAnimator(QObject *parent = nullptr); protected: @@ -152,6 +164,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickRotationAnimator : public QQuickAnimator Q_OBJECT Q_DECLARE_PRIVATE(QQuickRotationAnimator) Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged) + QML_NAMED_ELEMENT(RotationAnimator) + QML_ADDED_IN_MINOR_VERSION(2) public: enum RotationDirection { Numerical, Shortest, Clockwise, Counterclockwise }; @@ -177,6 +191,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickUniformAnimator : public QQuickAnimator Q_OBJECT Q_DECLARE_PRIVATE(QQuickUniformAnimator) Q_PROPERTY(QString uniform READ uniform WRITE setUniform NOTIFY uniformChanged) + QML_NAMED_ELEMENT(UniformAnimator) + QML_ADDED_IN_MINOR_VERSION(2) public: QQuickUniformAnimator(QObject *parent = nullptr); |