summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-29 08:13:40 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-29 08:13:40 +0200
commitcc74452d6d259d36ac47c536f11a5efb269e8e44 (patch)
treee43ac89e9edde354d12fbddffcbb6e40108cc643 /src/widgets/kernel
parent6cbd982836266a59e926d8f149ad0013bd8162a3 (diff)
parente52fcb7dc78c83586c813f55f087a98bae4eaa0e (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: configure src/plugins/platforms/winrt/qwinrtclipboard.cpp Change-Id: Ic6d58be3d1ed2bb507f2ba06c82361afd9f9ddb9
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index ba02728d7c..0d9cff01c4 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -10372,14 +10372,13 @@ void QWidgetPrivate::setWindowFlags(Qt::WindowFlags flags)
// the old type was a window and/or the new type is a window
QPoint oldPos = q->pos();
bool visible = q->isVisible();
+ const bool windowFlagChanged = (q->data->window_flags ^ flags) & Qt::Window;
q->setParent(q->parentWidget(), flags);
// if both types are windows or neither of them are, we restore
// the old position
- if (!((q->data->window_flags ^ flags) & Qt::Window)
- && (visible || q->testAttribute(Qt::WA_Moved))) {
+ if (!windowFlagChanged && (visible || q->testAttribute(Qt::WA_Moved)))
q->move(oldPos);
- }
// for backward-compatibility we change Qt::WA_QuitOnClose attribute value only when the window was recreated.
adjustQuitOnCloseAttribute();
} else {