Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt application title

I'm developping a Qt application

I managed to set the main window title using methode

setWindowTitle("my title");

however this changes the name in the application top bar, it doesn't affect the title displayed in the top bar of gnome shell (ubuntu) nor the title displayed when doing alt+tab.

How to change it ?

I've tried using the DEPLOYMENT.display_name variable in my .pro file

like image 940
Amxx Avatar asked Nov 08 '12 14:11

Amxx


2 Answers

Try using QCoreApplication::setApplicationName("your title") in your main code.

like image 101
Jokahero Avatar answered Sep 17 '22 05:09

Jokahero


Once properly set programmatically, to get the application name for use as title just use the static getter method QCoreApplication::applicationName() or QtGUIApplication::applicationDisplayName() (since V5).

From V5, these will fall back to the executable name if the property is not set.

Example use:

QCoreApplication::setApplicationName( QString("My Application") );
setWindowTitle( QCoreApplication::applicationName() );

Alternatively, set the Window title with Qt Designer and access it with windowTitle().

like image 30
handle Avatar answered Sep 17 '22 05:09

handle