summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-16 15:26:19 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-10-16 16:03:39 (GMT)
commit943290b3e72c9d9081ad95489a4319889e1a073a (patch)
tree80ebfb9f2c80bc456d24e26c945baf3ec9b5a2f7
parent0dd237d05a865c51ad59f4e9f61b194659e32814 (diff)
downloadQt-943290b3e72c9d9081ad95489a4319889e1a073a.zip
Qt-943290b3e72c9d9081ad95489a4319889e1a073a.tar.gz
Qt-943290b3e72c9d9081ad95489a4319889e1a073a.tar.bz2
This reverts commit 99739f35bf700a2bff707da99f5043cd7c12aed5.
Don't create native windows when setting the window title, delay the creation until the native window is needed. If a user really needs the window to be created, he/she can call winId() on the widget or set Qt::AA_ImmediateWidgetCreation. Reviewed-by: Bradley T. Hughes
-rw-r--r--src/gui/kernel/qwidget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 56602f7..a071ba6 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1354,6 +1354,8 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
d->setWindowIcon_sys(true);
if (isWindow() && !d->topData()->iconText.isEmpty())
d->setWindowIconText_helper(d->topData()->iconText);
+ if (isWindow() && !d->topData()->caption.isEmpty())
+ d->setWindowTitle_helper(d->topData()->caption);
if (windowType() != Qt::Desktop) {
d->updateSystemBackground();
@@ -5664,9 +5666,8 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
void QWidgetPrivate::setWindowTitle_helper(const QString &title)
{
Q_Q(QWidget);
- if (!q->testAttribute(Qt::WA_WState_Created))
- createWinId();
- setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q));
+ if (q->testAttribute(Qt::WA_WState_Created))
+ setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q));
}
void QWidgetPrivate::setWindowIconText_helper(const QString &title)