How to set QMainWindow title

2020-06-06 18:02发布

问题:

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.

回答1:

The method is setWindowTitle():

setWindowTitle(const QString &)

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