aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickspinbox.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2019-03-27 16:23:24 +0100
committerMitch Curtis <mitch.curtis@qt.io>2019-04-08 08:40:54 +0000
commit2431853d824c6416f2cb760485df5cb4c27db7e5 (patch)
tree11ec5624cf4e78cf1a218e8aa5c458326f354d5a /src/quicktemplates2/qquickspinbox.cpp
parentbb4b463c93623635154749e200304d8210b88bda (diff)
SpinBox: fix indicators being hovered when mouse is moved while pressed
We also need to update the hovered state of each indicator when the mouse is moved while pressed, not just when we get hover move events. Change-Id: I6fa71344fd540f648683958e5804ae735523e72d Fixes: QTBUG-74688 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickspinbox.cpp')
-rw-r--r--src/quicktemplates2/qquickspinbox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp
index 6af1d8e8..274929b0 100644
--- a/src/quicktemplates2/qquickspinbox.cpp
+++ b/src/quicktemplates2/qquickspinbox.cpp
@@ -362,8 +362,10 @@ void QQuickSpinBoxPrivate::handleMove(const QPointF &point)
QQuickControlPrivate::handleMove(point);
QQuickItem *ui = up->indicator();
QQuickItem *di = down->indicator();
- up->setPressed(ui && ui->isEnabled() && ui->contains(ui->mapFromItem(q, point)));
- down->setPressed(di && di->isEnabled() && di->contains(di->mapFromItem(q, point)));
+ up->setHovered(ui && ui->isEnabled() && ui->contains(ui->mapFromItem(q, point)));
+ up->setPressed(up->isHovered());
+ down->setHovered(di && di->isEnabled() && di->contains(di->mapFromItem(q, point)));
+ down->setPressed(down->isHovered());
bool pressed = up->isPressed() || down->isPressed();
q->setAccessibleProperty("pressed", pressed);