diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 8 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index f0431ebd9d..1e27b5b7c9 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -471,6 +471,8 @@ static QWindowGeometrySpecification windowGeometrySpecification; and will make the application wait until a debugger connects to it. \li -session \e session, restores the application from an earlier \l{Session Management}{session}. + \li -qwindowgeometry, sets the geometry of the first window + \li -qwindowtitle, sets the title of the first window \endlist \sa arguments() @@ -1033,6 +1035,9 @@ void QGuiApplicationPrivate::createPlatformIntegration() } else if (arg == "-qwindowgeometry" || (platformName == "xcb" && arg == "-geometry")) { if (++i < argc) windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]); + } else if (arg == "-qwindowtitle" || (platformName == "xcb" && arg == "-title")) { + if (++i < argc) + firstWindowTitle = QString::fromLocal8Bit(argv[i]); } else { argv[j++] = argv[i]; } diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 57c55e1e0f..22f1cb9aa8 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -231,6 +231,8 @@ public: static bool noGrab; QInputMethod *inputMethod; + QString firstWindowTitle; + static QList<QObject *> generic_plugin_list; #ifndef QT_NO_SHORTCUT QShortcutMap shortcutMap; diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 42f61399d9..2382764183 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -432,6 +432,14 @@ void QWindow::setVisible(bool visible) // remove posted quit events when showing a new window QCoreApplication::removePostedEvents(qApp, QEvent::Quit); + if (type() == Qt::Window) { + QString &firstWindowTitle = QGuiApplicationPrivate::instance()->firstWindowTitle; + if (!firstWindowTitle.isEmpty()) { + setTitle(firstWindowTitle); + firstWindowTitle = QString(); + } + } + QShowEvent showEvent; QGuiApplication::sendEvent(this, &showEvent); } |