#includeIn this example, we create a QMainWindow widget and a QToolBar widget. We then add some actions to the toolbar and set its parent to the main window using the setParent method. Finally, we show the main window and start the Qt event loop. The Qt library provides the QWidget class as part of its core module, so no additional library packages are needed.int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow main_window; main_window.setGeometry(100, 100, 500, 500); QToolBar toolbar; toolbar.addAction("Action 1"); toolbar.addAction("Action 2"); toolbar.setParent(&main_window); main_window.show(); return app.exec(); }