diff options
author | Michael Brasser <mbrasser@ford.com> | 2017-10-26 21:52:00 -0500 |
---|---|---|
committer | Michael Brasser <michael.brasser@live.com> | 2018-05-03 14:04:58 +0000 |
commit | 9506f274faf75f48b2d6639647603feab401eb8b (patch) | |
tree | c76a7c14f9f3067b21ee3bde8e320c0d93f179fc /src/quick/items/qquickrectangle_p.h | |
parent | 96bb8ff5dd133a00bff6a7a713c59736441e1c78 (diff) |
Add support for horizontal gradients in Rectangle
[ChangeLog][QtQuick] Added support for horizontal gradients in
Rectangle.
Change-Id: I4feee8ec93d9fe75a9f91a7afbe33c8d4756cedb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/items/qquickrectangle_p.h')
-rw-r--r-- | src/quick/items/qquickrectangle_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h index c07ad835fb..ddafaafb28 100644 --- a/src/quick/items/qquickrectangle_p.h +++ b/src/quick/items/qquickrectangle_p.h @@ -119,24 +119,34 @@ class Q_QUICK_PRIVATE_EXPORT QQuickGradient : public QObject Q_OBJECT Q_PROPERTY(QQmlListProperty<QQuickGradientStop> stops READ stops) + Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged REVISION 12) Q_CLASSINFO("DefaultProperty", "stops") public: QQuickGradient(QObject *parent=nullptr); ~QQuickGradient() override; + enum Orientation { Vertical = Qt::Vertical, + Horizontal = Qt::Horizontal }; + Q_ENUM(Orientation) + QQmlListProperty<QQuickGradientStop> stops(); + Orientation orientation() const { return m_orientation; } + void setOrientation(Orientation orientation); + QGradientStops gradientStops() const; Q_SIGNALS: void updated(); + void orientationChanged(); private: void doUpdate(); private: QList<QQuickGradientStop *> m_stops; + Orientation m_orientation = Vertical; friend class QQuickRectangle; friend class QQuickGradientStop; }; |