diff options
author | David Faure <david.faure@kdab.com> | 2014-01-30 21:59:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 20:12:17 +0100 |
commit | bf82245bafad25403aeb7129ebe1fc419c6f4ad9 (patch) | |
tree | b98c11d63ea3a388333341a7bad6789fa6fb59bf /src/gui/kernel/qwindow.cpp | |
parent | eacd58d4e78e7238ba5fcca90ba960aaf3ebd263 (diff) |
Restore support for -title command line argument on X11, add -qwindowtitle.
-title disappeared between Qt4 and Qt5, due to all the refactorings around QPA.
Making the caption of the mainwindow configurable allows custom setups
for specific users or use cases.
[ChangeLog][QtGui][QGuiApplication] Restore support for -title command line
argument on X11, add -qwindowtitle on all platforms.
Change-Id: I73e6bf21248f3419178eba583b257172a175e74e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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); } |