aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickswitch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickswitch.cpp')
-rw-r--r--src/quicktemplates2/qquickswitch.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickswitch.cpp b/src/quicktemplates2/qquickswitch.cpp
index fa1b5463..c1a7d34a 100644
--- a/src/quicktemplates2/qquickswitch.cpp
+++ b/src/quicktemplates2/qquickswitch.cpp
@@ -186,10 +186,14 @@ void QQuickSwitch::mirrorChange()
void QQuickSwitch::nextCheckState()
{
Q_D(QQuickSwitch);
- if (keepMouseGrab())
+ if (keepMouseGrab()) {
setChecked(d->position > 0.5);
- else
+ // the checked state might not change => force a position update to
+ // avoid that the handle is left somewhere in the middle (QTBUG-57944)
+ checkStateSet();
+ } else {
QQuickAbstractButton::nextCheckState();
+ }
}
void QQuickSwitch::checkStateSet()