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
Try using QCoreApplication::setApplicationName("your title") in your main code.
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()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With