diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-11-03 16:42:14 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-11-08 10:13:49 +0000 |
commit | f246314b21604c5fe2a2abe0aec8af89f06eb610 (patch) | |
tree | b66ed350b4a1ba96b0b1c90bc64f923b1ae74e66 /src/quicktemplates2/qquickscrollindicator_p.h | |
parent | 501d45012f746d843e0144c78202297a577758bc (diff) |
ScrollIndicator: allow configuring the minimum size
Same as 9e1b044 for ScrollBar.
The existing size and position properties cannot be changed,
because then they won't match with Flickable::visibleArea and
we get major problems connecting the two. Thus, the effective
visible position and size are provided as separate properties.
[ChangeLog][Controls][ScrollIndicator] Added minimumSize, visualSize,
and visualPosition properties.
Task-number: QTBUG-56557
Change-Id: I7deda3bea7a5a020bda79af433bfa38f326952d8
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickscrollindicator_p.h')
-rw-r--r-- | src/quicktemplates2/qquickscrollindicator_p.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickscrollindicator_p.h b/src/quicktemplates2/qquickscrollindicator_p.h index d679cf74..4fa06a33 100644 --- a/src/quicktemplates2/qquickscrollindicator_p.h +++ b/src/quicktemplates2/qquickscrollindicator_p.h @@ -66,6 +66,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickScrollIndicator : public QQuickCont // 2.3 (Qt 5.10) Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + // 2.4 (Qt 5.11) + Q_PROPERTY(qreal minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged FINAL REVISION 4) + Q_PROPERTY(qreal visualSize READ visualSize NOTIFY visualSizeChanged FINAL REVISION 4) + Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL REVISION 4) public: explicit QQuickScrollIndicator(QQuickItem *parent = nullptr); @@ -85,6 +89,13 @@ public: bool isHorizontal() const; bool isVertical() const; + // 2.4 (Qt 5.11) + qreal minimumSize() const; + void setMinimumSize(qreal minimumSize); + + qreal visualSize() const; + qreal visualPosition() const; + public Q_SLOTS: void setSize(qreal size); void setPosition(qreal position); @@ -94,6 +105,10 @@ Q_SIGNALS: void positionChanged(); void activeChanged(); void orientationChanged(); + // 2.4 (Qt 5.11) + Q_REVISION(4) void minimumSizeChanged(); + Q_REVISION(4) void visualSizeChanged(); + Q_REVISION(4) void visualPositionChanged(); protected: #if QT_CONFIG(quicktemplates2_multitouch) |