Qt application title

The application name is distinct from the window title. The window manager usually draws the window title into the title bar of the (main) window, while the application name is used by (e.g. Gnome) to represent the application itself.

Qt seems to be passing on the first argument's first item of its constructor's signature to the underlying window-manager:

app = QApplication(('My Application Name',))

QApplication.applicationName seems to be mainly used for application-internal purposes.


A more complete (basic) set-up would then look something like this (in Python, C++ would be analogous) - not the invocation of MyQApplication's superclass's constructor:

from PySide import QtCore, QtGui
import sys


class MyQApplication(QtGui.QApplication):
    def __init__(self, app_name):
        super(MyQApplication, self).__init__((app_name,))

        self.setApplicationName(app_name)

        self.main_window = QtGui.QMainWindow()
        self.main_window.setWindowTitle("My Application's Main Window")
        self.main_window.show()


if __name__ == '__main__':
    app = MyQApplication("My Application's Name")
    sys.exit(app.exec_())


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().