From bf82245bafad25403aeb7129ebe1fc419c6f4ad9 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 30 Jan 2014 21:59:41 +0100 Subject: 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 Reviewed-by: Albert Astals Cid Reviewed-by: Paul Olav Tvete Reviewed-by: Frederik Gladhorn --- .../auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/auto/gui') 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("tst_qguiapplication"), const_cast("-qwindowtitle"), const_cast("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: -- cgit v1.2.3