aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp18
-rw-r--r--src/quicktemplates2/qquickcombobox_p.h1
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp9
-rw-r--r--src/quicktemplates2/qquickslider.cpp6
4 files changed, 28 insertions, 6 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 65d17366..d4280b30 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -1698,9 +1698,11 @@ void QQuickComboBox::keyReleaseEvent(QKeyEvent *event)
break;
case Qt::Key_Escape:
case Qt::Key_Back:
- d->hidePopup(false);
- setPressed(false);
- event->accept();
+ if (d->isPopupVisible()) {
+ d->hidePopup(false);
+ setPressed(false);
+ event->accept();
+ }
break;
default:
break;
@@ -1740,6 +1742,16 @@ void QQuickComboBox::componentComplete()
}
}
+void QQuickComboBox::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value)
+{
+ Q_D(QQuickComboBox);
+ QQuickControl::itemChange(change, value);
+ if (change == ItemVisibleHasChanged && !value.boolValue) {
+ d->hidePopup(false);
+ setPressed(false);
+ }
+}
+
void QQuickComboBox::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
{
Q_D(QQuickComboBox);
diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h
index 11fddefa..75e535a9 100644
--- a/src/quicktemplates2/qquickcombobox_p.h
+++ b/src/quicktemplates2/qquickcombobox_p.h
@@ -204,6 +204,7 @@ protected:
#endif
void componentComplete() override;
+ void itemChange(ItemChange change, const ItemChangeData &value) override;
void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index e5c0766b..b06cb23c 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -807,7 +807,8 @@ qreal QQuickRangeSlider::valueAt(qreal position) const
\l {first.visualPosition}{visualPosition} should be used instead.
\row
\li pressed
- \li This property holds whether the first handle is pressed.
+ \li This property holds whether the first handle is pressed by either touch,
+ mouse, or keys.
\row
\li hovered
\li This property holds whether the first handle is hovered.
@@ -881,7 +882,8 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const
\l {second.visualPosition}{visualPosition} should be used instead.
\row
\li pressed
- \li This property holds whether the second handle is pressed.
+ \li This property holds whether the second handle is pressed by either touch,
+ mouse, or keys.
\row
\li hovered
\li This property holds whether the second handle is hovered.
@@ -938,6 +940,9 @@ void QQuickRangeSlider::setStepSize(qreal step)
This property holds the snap mode.
+ The snap mode determines how the slider handles behave with
+ regards to the \l stepSize.
+
Possible values:
\value RangeSlider.NoSnap The slider does not snap (default).
\value RangeSlider.SnapAlways The slider snaps while the handle is dragged.
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index 406199c9..1e6e0c25 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -448,6 +448,9 @@ void QQuickSlider::setStepSize(qreal step)
This property holds the snap mode.
+ The snap mode determines how the slider handle behaves with
+ regards to the \l stepSize.
+
Possible values:
\value Slider.NoSnap The slider does not snap (default).
\value Slider.SnapAlways The slider snaps while the handle is dragged.
@@ -486,7 +489,8 @@ void QQuickSlider::setSnapMode(SnapMode mode)
/*!
\qmlproperty bool QtQuick.Controls::Slider::pressed
- This property holds whether the slider is pressed.
+ This property holds whether the slider is pressed by either touch, mouse,
+ or keys.
*/
bool QQuickSlider::isPressed() const
{