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 /tests/auto/gui | |
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 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index d4237b135f..6ef9957fa1 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -60,6 +60,7 @@ class tst_QGuiApplication: public tst_QCoreApplication private slots: void displayName(); + void firstWindowTitle(); void focusObject(); void allWindows(); void topLevelWindows(); @@ -83,6 +84,17 @@ void tst_QGuiApplication::displayName() QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The GUI Application")); } +void tst_QGuiApplication::firstWindowTitle() +{ + int argc = 3; + char *argv[] = { const_cast<char*>("tst_qguiapplication"), const_cast<char*>("-qwindowtitle"), const_cast<char*>("User Title") }; + QGuiApplication app(argc, argv); + QWindow window; + window.setTitle("Application Title"); + window.show(); + QCOMPARE(window.title(), QString("User Title")); +} + class DummyWindow : public QWindow { public: |