From 943290b3e72c9d9081ad95489a4319889e1a073a Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Fri, 16 Oct 2009 17:26:19 +0200 Subject: 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 --- src/gui/kernel/qwidget.cpp | 7 ++++--- 1 file 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) -- cgit v0.12