diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-03-28 12:36:51 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-03-28 11:12:38 +0000 |
commit | befa702ce798b35085594233520359e12e2e79e1 (patch) | |
tree | 05c05639fd3b8b458f607be9387bf8b7d8897342 /src/quicktemplates2/qquickrangeslider.cpp | |
parent | 72e12f8e5ee54a919c254000a017f3f918825406 (diff) |
RangeSlider: add horizontal and vertical properties for convenience
[ChangeLog][Controls][RangeSlider] Added horizontal and vertical
properties to make it more convenient to create orientation-dependent
bindings in styles.
Change-Id: Iac2ae7d4d701cf9516521923cf27416d76dfba5c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickrangeslider.cpp')
-rw-r--r-- | src/quicktemplates2/qquickrangeslider.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp index 1c74f9ee..175ca06e 100644 --- a/src/quicktemplates2/qquickrangeslider.cpp +++ b/src/quicktemplates2/qquickrangeslider.cpp @@ -757,6 +757,8 @@ void QQuickRangeSlider::setSnapMode(SnapMode mode) Possible values: \value Qt.Horizontal Horizontal (default) \value Qt.Vertical Vertical + + \sa horizontal, vertical */ Qt::Orientation QQuickRangeSlider::orientation() const { @@ -775,6 +777,36 @@ void QQuickRangeSlider::setOrientation(Qt::Orientation orientation) } /*! + \since QtQuick.Controls 2.3 + \qmlproperty bool QtQuick.Controls::RangeSlider::horizontal + \readonly + + This property holds whether the slider is horizontal. + + \sa orientation +*/ +bool QQuickRangeSlider::isHorizontal() const +{ + Q_D(const QQuickRangeSlider); + return d->orientation == Qt::Horizontal; +} + +/*! + \since QtQuick.Controls 2.3 + \qmlproperty bool QtQuick.Controls::RangeSlider::vertical + \readonly + + This property holds whether the slider is vertical. + + \sa orientation +*/ +bool QQuickRangeSlider::isVertical() const +{ + Q_D(const QQuickRangeSlider); + return d->orientation == Qt::Vertical; +} + +/*! \since QtQuick.Controls 2.2 \qmlproperty bool QtQuick.Controls::RangeSlider::live |