#includeint main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.setWindowTitle("My Window Title"); window.show(); return app.exec(); }
#includeThis example creates a window using QMainWindow and adds a QLabel displaying the text "Hello, world!" as its central widget. The window title is set to "My Window Title" using setWindowTitle. Package library: QtWidgetsint main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow window; window.setCentralWidget(new QLabel("Hello, world!")); window.setWindowTitle("My Window Title"); window.show(); return app.exec(); }