diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-12-14 16:15:44 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-04 14:18:24 (GMT) |
commit | a7fc0e8bad3bd020ece5fa70f0462bcaf59b3d77 (patch) | |
tree | eb49255946f2632e8fe9a96cbbeb3b7cea619be5 /src/gui | |
parent | e90cb6992e35ed4b9c2aae85edb8d787c24a8a6c (diff) | |
download | Qt-a7fc0e8bad3bd020ece5fa70f0462bcaf59b3d77.zip Qt-a7fc0e8bad3bd020ece5fa70f0462bcaf59b3d77.tar.gz Qt-a7fc0e8bad3bd020ece5fa70f0462bcaf59b3d77.tar.bz2 |
Fix nativechild widget position in Lighthouse
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qwidget_qpa.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index dce23a3..001810e 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -162,7 +162,6 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) { Q_Q(QWidget); - // QWidget *oldParent = q->parentWidget(); Qt::WindowFlags oldFlags = data.window_flags; int targetScreen = -1; @@ -214,13 +213,6 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) data.window_flags = window->setWindowFlags(data.window_flags); } - // Reparenting child to toplevel - if ((f&Qt::Window) && !(oldFlags&Qt::Window)) { - //qDebug() << "setParent_sys() change to toplevel"; - q->create(); //### too early: this ought to happen at show() time - } - - if (q->isWindow() || (!newparent || newparent->isVisible()) || explicitlyHidden) q->setAttribute(Qt::WA_WState_Hidden); q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden); @@ -396,7 +388,11 @@ void QWidgetPrivate::show_sys() QPlatformWindow *window = q->platformWindow(); if (window) { - const QRect geomRect = q->geometry(); + QRect geomRect = q->geometry(); + if (!q->isWindow()) { + QPoint topLeftOfWindow = q->mapTo(q->nativeParentWidget(),QPoint()); + geomRect.moveTopLeft(topLeftOfWindow); + } const QRect windowRect = window->geometry(); if (windowRect != geomRect) { window->setGeometry(geomRect); @@ -591,7 +587,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (q->isVisible()) { if (q->platformWindow()) { if (q->isWindow()) { - q->platformWindow()->setGeometry(q->frameGeometry()); + q->platformWindow()->setGeometry(q->geometry()); } else { QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint()); q->platformWindow()->setGeometry(QRect(posInNativeParent,r.size())); |