summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2010-05-11 06:49:23 (GMT)
committerJason Barron <jbarron@trolltech.com>2010-05-12 06:11:44 (GMT)
commitbb6daf55c88addd58db914e62245b3e3296308b8 (patch)
treefb333bb1aa3625821ca5f2b1e541d2c42a2d42f3 /src
parent3ab4fe8969f443bab867ac15c3b7d35ae31d9903 (diff)
downloadQt-bb6daf55c88addd58db914e62245b3e3296308b8.zip
Qt-bb6daf55c88addd58db914e62245b3e3296308b8.tar.gz
Qt-bb6daf55c88addd58db914e62245b3e3296308b8.tar.bz2
Don't crash when applications set Qt::WA_TranslucentBackground.
After replacing some code with a function call to s60UpdateIsOpaque() we introduced a crash for widgets that set Qt::WA_TranslucentBackground. The reason for the crash was that the Qt::WA_WState_Created attribute was being set before calling this function, but *not* before setWinId() was being called. This meant that s60UpdateIsOpaque() assumed that the window was created (and the handle added to the widget map), but this was not actually the case. The fix here is to move the call to s60UpdateIsOpaque() after the call to setWinId() such that those assumptions are true. Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index a0429d3..02e7cb8 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -387,7 +387,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
| EPointerFilterMove | EPointerFilterDrag, 0);
drawableWindow->EnableVisibilityChangeEvents();
- s60UpdateIsOpaque();
}
q->setAttribute(Qt::WA_WState_Created);
@@ -400,6 +399,9 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
// this generates a WinIdChanged event.
setWinId(control.take());
+ if (!desktop)
+ s60UpdateIsOpaque(); // must be called after setWinId()
+
} else if (q->testAttribute(Qt::WA_NativeWindow) || paintOnScreen()) { // create native child widget
QScopedPointer<QSymbianControl> control( q_check_ptr(new QSymbianControl(q)) );