How to set QMainWindow title

houbysoft picture houbysoft · Dec 28, 2010 · Viewed 31.5k times · Source

How do I set the title of a QMainWindow?

I tried googling and found setCaption(), but it appears it no longer works in Qt 4.

Answer

Edward Strange picture Edward Strange · Dec 28, 2010

The method is setWindowTitle():

setWindowTitle(const QString &)

http://doc.qt.io/qt-4.8/qwidget.html#windowTitle-prop