diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-28 12:25:38 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-28 12:30:58 (GMT) |
commit | b806fe453139ca67d192fda7fa6de8d23889c7c6 (patch) | |
tree | ddc3108d1c6ff6d77299e34851011b17e8977e48 /src | |
parent | 8987b495c5026976e23d910e68c7892c4c81e586 (diff) | |
download | Qt-b806fe453139ca67d192fda7fa6de8d23889c7c6.zip Qt-b806fe453139ca67d192fda7fa6de8d23889c7c6.tar.gz Qt-b806fe453139ca67d192fda7fa6de8d23889c7c6.tar.bz2 |
Further modifications to native window resizing code
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 39 |
2 files changed, 21 insertions, 26 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 9d44481..b369168 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -320,6 +320,14 @@ void QSymbianControl::ConstructL(bool topLevel, bool desktop) if (topLevel or !qwidget->parentWidget()) CreateWindowL(S60->windowGroup()); else + /** + * TODO: in order to avoid creating windows for all ancestors of + * this widget up to the root window, the parameter passed to + * CreateWindowL should be + * qwidget->parentWidget()->effectiveWinId(). However, if we do + * this, then we need to take care of re-parenting when a window + * is created for a widget between this one and the root window. + */ CreateWindowL(qwidget->parentWidget()->winId()); SetFocusing(true); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index ba45bdd..3cc810e 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -202,8 +202,10 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) if (data.wrect.contains(vrect)) { xrect = data.wrect; xrect.translate(data.crect.topLeft()); - if (data.winid) - data.winid->SetPosition(TPoint(xrect.x(), xrect.y())); + if (data.winid) { + data.winid->SetExtent(TPoint(xrect.x(), xrect.y()), TSize(xrect.width(), xrect.height())); + data.winid->DrawNow(); + } return; } } @@ -258,16 +260,10 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) if (!parent->internalWinId()) xrect.translate(parent->mapTo(q->nativeParentWidget(), QPoint(0, 0))); data.winid->SetExtent(TPoint(xrect.x(), xrect.y()), TSize(xrect.width(), xrect.height())); + if(!jump) + data.winid->DrawNow(); } - if (mapWindow and !dontShow) { - q->setAttribute(Qt::WA_Mapped); - if (q->internalWinId()) - q->internalWinId()->DrawableWindow()->SetVisible(ETrue); - } - -/* - * Not present in Windows port, so we omit it here aswell ... - * + //to avoid flicker, we have to show children after the helper widget has moved if (jump) { for (int i = 0; i < children.size(); ++i) { @@ -277,29 +273,20 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &) if (!w->testAttribute(Qt::WA_OutsideWSRange) && !w->testAttribute(Qt::WA_Mapped) && !w->isHidden()) { w->setAttribute(Qt::WA_Mapped); if (w->internalWinId()) - XMapWindow(dpy, w->data->winid); + w->data->winid->DrawableWindow()->SetVisible(ETrue); } } } } -*/ -/* - * TODO: how to invalidate part of the control? - * if (jump && data.winid) - data.winid->Draw(TRect(0, 0, wrect.width(), wrect.height())); -*/ - -/* - * Not present in Windows port, so we omit it here aswell ... - * - if (mapWindow && !dontShow) { + data.winid->DrawNow(TRect(0, 0, wrect.width(), wrect.height())); + + if (mapWindow and !dontShow) { q->setAttribute(Qt::WA_Mapped); - if (data.winid) - XMapWindow(dpy, data.winid); + if (q->internalWinId()) + q->internalWinId()->DrawableWindow()->SetVisible(ETrue); } -*/ } void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) |