summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-16 11:40:34 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-16 10:44:30 +0000
commit9568abd142d581b67b86a5f63d823a34b0612702 (patch)
treea7b434b78d4058985414b903f39ee1714e55c518
parentee17851b42f21bb92c4b7581e80c0319e5384e6b (diff)
qtwinmigrate: Fix geometry offsetHEADmaster
Set the property "_q_embedded_native_parent_handle" on the widget before calling winId() so that it takes effect during native window creation. The bug was unveiled by qtbase/3035400f36731c400adb9204b94e9afe346a71b7. Task-number: QTSOLBUG-196 Change-Id: I5dac836b2845de9833da46bfb72d07aafdf4896a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r--qtwinmigrate/src/qwinwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qtwinmigrate/src/qwinwidget.cpp b/qtwinmigrate/src/qwinwidget.cpp
index 4a04751..fffa774 100644
--- a/qtwinmigrate/src/qwinwidget.cpp
+++ b/qtwinmigrate/src/qwinwidget.cpp
@@ -123,6 +123,9 @@ void QWinWidget::init()
Q_ASSERT(hParent);
if (hParent) {
+#if QT_VERSION >= 0x050000
+ setProperty("_q_embedded_native_parent_handle", WId(hParent));
+#endif
// make the widget window style be WS_CHILD so SetParent will work
QT_WA({
SetWindowLong((HWND)winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
@@ -131,7 +134,6 @@ void QWinWidget::init()
})
#if QT_VERSION >= 0x050000
QWindow *window = windowHandle();
- window->setProperty("_q_embedded_native_parent_handle", (WId)hParent);
HWND h = static_cast<HWND>(QGuiApplication::platformNativeInterface()->
nativeResourceForWindow("handle", window));
SetParent(h, hParent);