summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindow.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-10-25 07:21:05 +0200
committerLiang Qi <liang.qi@qt.io>2018-10-25 07:21:53 +0200
commite28e91ae99b8c3859899e04cc9370534c7c7b86d (patch)
treecca81b1e745be4f25aab78e8e917c2324594e539 /src/widgets/widgets/qmainwindow.cpp
parent5ea233ca6782eb27adf596515cb66ef3dadc1d5e (diff)
parentebfad73b4e44fe6db8059200da105b4b87888718 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r--src/widgets/widgets/qmainwindow.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 9172168761..fae3aebba4 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -249,14 +249,7 @@ void QMainWindowPrivate::init()
An example of how to create menus follows:
- \code
- void MainWindow::createMenus()
- {
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- \endcode
+ \snippet code/src_widgets_widgets_qmainwindow.cpp 0
The \c createPopupMenu() function creates popup menus when the
main window receives context menu events. The default
@@ -283,12 +276,7 @@ void QMainWindowPrivate::init()
An example of toolbar creation follows:
- \code
- void MainWindow::createToolBars()
- {
- fileToolBar = addToolBar(tr("File"));
- fileToolBar->addAction(newAct);
- \endcode
+ \snippet code/src_widgets_widgets_qmainwindow.cpp 1
\section2 Creating Dock Widgets
@@ -1231,9 +1219,8 @@ Qt::DockWidgetArea QMainWindow::dockWidgetArea(QDockWidget *dockwidget) const
to the relative weight of the sizes.
Example:
- \code
- resizeDocks({blueWidget, yellowWidget}, {20 , 40}, Qt::Horizontal);
- \endcode
+ \snippet code/src_widgets_widgets_qmainwindow.cpp 2
+
If the blue and the yellow widget are nested on the same level they will be
resized such that the yellowWidget is twice as big as the blueWidget