summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-05-19 10:51:34 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-05-19 10:53:30 +0200
commitea7277690d9f4a7c4e10f3d3b7a2bef46d6878c2 (patch)
tree620b3d1acc7f8d5855f84248635d9a43f5e57476 /src/widgets
parente0e696dd05fbe329044879cf560fe26330edf7bd (diff)
Better setWindowFlags() support in XCB window.
We need to re-create the native window in setParent, as used to be done in QWidgetPrivate::setParent_sys in qwidget_x11.cpp.
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index a4c68c16a5..6721fdbb6a 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -93,13 +93,14 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
QWindow *win = topData()->window;
+ win->setWindowFlags(data.window_flags);
+ win->setGeometry(q->geometry());
+
if (QWidget *nativeParent = q->nativeParentWidget()) {
if (nativeParent->windowHandle())
win->setParent(nativeParent->windowHandle());
}
- win->setWindowFlags(data.window_flags);
- win->setGeometry(q->geometry());
win->create();
data.window_flags = win->windowFlags();
@@ -174,13 +175,12 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
if (parent != newparent) {
QObjectPrivate::setParent_helper(newparent); //### why does this have to be done in the _sys function???
- if (q->windowHandle() && newparent) {
- QWidget * parentWithWindow = newparent->windowHandle()? newparent : newparent->nativeParentWidget();
- if (parentWithWindow && parentWithWindow->windowHandle()) {
- q->windowHandle()->setParent(parentWithWindow->windowHandle());
- }
+ if (q->windowHandle()) {
+ q->windowHandle()->setWindowFlags(f);
+ QWidget *parentWithWindow =
+ newparent ? (newparent->windowHandle() ? newparent : newparent->nativeParentWidget()) : 0;
+ q->windowHandle()->setParent(parentWithWindow ? parentWithWindow->windowHandle() : 0);
}
-
}
if (!newparent) {