diff options
author | Liang Qi <liang.qi@qt.io> | 2017-01-14 21:58:48 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-01-14 21:58:48 +0100 |
commit | 537eced61381f0ce1eabdc797bb0dacd11e11d39 (patch) | |
tree | 13ccb774329ca0214e89675e5f1d1ffa638f8ef6 /src/quicktemplates2/qquickswitchdelegate.cpp | |
parent | 698cffce2171bed322aa9d0df1fda316c379efda (diff) | |
parent | 6f7852a307c7ebbdb3b6efa00cbf7626b072bbc1 (diff) |
Merge remote-tracking branch 'origin/5.8.0' into 5.8
Change-Id: Ibad627dfcd3389aeddfe08a10d13097c88f081a1
Diffstat (limited to 'src/quicktemplates2/qquickswitchdelegate.cpp')
-rw-r--r-- | src/quicktemplates2/qquickswitchdelegate.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp index 72b4803d..d0d14ae5 100644 --- a/src/quicktemplates2/qquickswitchdelegate.cpp +++ b/src/quicktemplates2/qquickswitchdelegate.cpp @@ -191,10 +191,14 @@ void QQuickSwitchDelegate::mirrorChange() void QQuickSwitchDelegate::nextCheckState() { Q_D(QQuickSwitchDelegate); - 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 { QQuickItemDelegate::nextCheckState(); + } } void QQuickSwitchDelegate::checkStateSet() |