How to change window title in Qt?

How to change window title in Qt? (Both for QDialog and QMainWindow .)

+46
c ++ qt window title
May 15 '12 at 9:56 a.m.
source share
3 answers
 void QWidget::setWindowTitle ( const QString & ) 

EDIT: If you use QtDesigner , the properties tab has an editable windowTitle property, which can be found in the QWidget section. The properties tab can usually be found in the lower right part of the designer window.

+77
May 15 '12 at 9:59 a.m.
source share

For new Qt users, this is a bit more confusing than it sounds if you use the QT Designer and .ui files.

At first I tried to use ui->setWindowTitle , but this does not exist. ui not a QDialog or QMainWindow .

The owner of ui is QDialog or QMainWindow , .ui just describes how to lay it out. In this case you should use:

 this->setWindowTitle("New Title"); 

I hope this helps someone else.

+36
Dec 28 '12 at 19:26
source share
 system("title WhateverYouWantToNameIt"); 
-one
May 26 '17 at 23:38
source share



All Articles