From 2431853d824c6416f2cb760485df5cb4c27db7e5 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 27 Mar 2019 16:23:24 +0100 Subject: SpinBox: fix indicators being hovered when mouse is moved while pressed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Frederik Gladhorn --- src/quicktemplates2/qquickspinbox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/quicktemplates2') 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); -- cgit v1.2.3