diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-06-27 16:16:19 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-10 04:33:05 +0000 |
commit | 1771d298f33543a3fe47decfe0fff10609b01ab1 (patch) | |
tree | 2f19e74f00c458a7a31afa6fe9ce21abba20f61a /src/quick/items/qquickrectangle_p.h | |
parent | ffbf089addcaab3e132f5dbb0685c1a46bd6d1ab (diff) |
Teach Rectangle's gradient property to accept QGradient::Preset
Change-Id: Id640b596c1d8d52221f2f2be8807d6e245971bdc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/items/qquickrectangle_p.h')
-rw-r--r-- | src/quick/items/qquickrectangle_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h index ddafaafb28..d56a03d22d 100644 --- a/src/quick/items/qquickrectangle_p.h +++ b/src/quick/items/qquickrectangle_p.h @@ -122,6 +122,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickGradient : public QObject Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged REVISION 12) Q_CLASSINFO("DefaultProperty", "stops") + Q_ENUMS(QGradient::Preset) public: QQuickGradient(QObject *parent=nullptr); ~QQuickGradient() override; @@ -157,7 +158,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickRectangle : public QQuickItem Q_OBJECT Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) - Q_PROPERTY(QQuickGradient *gradient READ gradient WRITE setGradient RESET resetGradient) + Q_PROPERTY(QJSValue gradient READ gradient WRITE setGradient RESET resetGradient) Q_PROPERTY(QQuickPen * border READ border CONSTANT) Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) public: @@ -168,8 +169,8 @@ public: QQuickPen *border(); - QQuickGradient *gradient() const; - void setGradient(QQuickGradient *gradient); + QJSValue gradient() const; + void setGradient(const QJSValue &gradient); void resetGradient(); qreal radius() const; |