![]() QMainWindow comes with a default menu bar, but you can also set one yourself with setMenuBar(). You can add new menus to the main window's menu bar by calling menuBar(), which returns the QMenuBar for the window, and then add a menu with QMenuBar::addMenu(). QActions are added to the menus, which display them as menu items. Qt implements menus in QMenu and QMainWindow keeps them in a QMenuBar. We give examples on how to create and add them. We will now examine each of the other widgets that can be added to a main window. You create MDI applications in Qt by using a QMdiArea as the central widget. Main windows have either a single (SDI) or multiple (MDI) document interface. You set the central widget with setCentralWidget(). Custom widgets can also be used for advanced applications. You can see an image of the layout below.Ī central widget will typically be a standard Qt widget such as a QTextEdit or a QGraphicsView. The layout has a center area that can be occupied by any kind of widget. QMainWindow has its own layout to which you can add QToolBars, QDockWidgets, a QMenuBar, and a QStatusBar. Qt has QMainWindow and its related classes for main window management. ToolBarArea(const QToolBar * toolbar) constĭetailed Description Qt Main Window FrameworkĪ main window provides a framework for building an application's user interface. TabifyDockWidget(QDockWidget * first, QDockWidget * second) TabifiedDockWidgets(QDockWidget * dockwidget) const TabPosition(Qt::DockWidgetArea area) const SplitDockWidget(QDockWidget * first, QDockWidget * second, Qt::Orientation orientation) SetToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle) SetTabShape(QTabWidget::TabShape tabShape) SetTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition) SetDockOptions(QMainWindow::DockOptions options) SetCorner(Qt::Corner corner, Qt::DockWidgetArea area) ![]() RestoreState(const QByteArray & state, int version = 0) RestoreDockWidget(QDockWidget * dockwidget) ResizeDocks(const QList & docks, const QList & sizes, Qt::Orientation orientation) RemoveDockWidget(QDockWidget * dockwidget) InsertToolBar(QToolBar * before, QToolBar * toolbar) QMainWindow(QWidget * parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())ĪddDockWidget(Qt::DockWidgetArea area, QDockWidget * dockwidget)ĪddDockWidget(Qt::DockWidgetArea area, QDockWidget * dockwidget, Qt::Orientation orientation)ĪddToolBar(Qt::ToolBarArea area, QToolBar * toolbar)ĪddToolBarBreak(Qt::ToolBarArea area = Qt::TopToolBarArea)ĭockWidgetArea(QDockWidget * dockwidget) const
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |