aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickswitchdelegate.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-01-20 12:55:54 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-01-20 12:55:54 +0100
commitbc29da5c224d277dfa94ae4e188df1db325ae83a (patch)
tree19eef227a11ab099fd04b909d326201ae7df7d8d /src/quicktemplates2/qquickswitchdelegate.cpp
parent5934c9670eaa6f0464c45857d72bcebf64902cc4 (diff)
parentc1b1e9a69a5770a59d0a4e59650c6487b9cd5439 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/quicktemplates2/qquickswitch.cpp src/quicktemplates2/qquickswitchdelegate.cpp tests/auto/controls/data/tst_dialogbuttonbox.qml tests/auto/controls/data/tst_toolbutton.qml Change-Id: I1da1d6de83c1d9ac854dfce1d6c9d6ba2c460404
Diffstat (limited to 'src/quicktemplates2/qquickswitchdelegate.cpp')
-rw-r--r--src/quicktemplates2/qquickswitchdelegate.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp
index 0523e332..82c9594c 100644
--- a/src/quicktemplates2/qquickswitchdelegate.cpp
+++ b/src/quicktemplates2/qquickswitchdelegate.cpp
@@ -188,10 +188,14 @@ void QQuickSwitchDelegate::mirrorChange()
void QQuickSwitchDelegate::nextCheckState()
{
Q_D(QQuickSwitchDelegate);
- if (keepMouseGrab())
+ if (keepMouseGrab()) {
d->toggle(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)
+ setPosition(d->checked ? 1.0 : 0.0);
+ } else {
QQuickItemDelegate::nextCheckState();
+ }
}
void QQuickSwitchDelegate::buttonChange(ButtonChange change)