Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
doc_src_qt4-mainwindow.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QtWidgets
>
5
6
#
include
"../include/mainwindow.h"
7
8
//! [0]
9
MainWindow::MainWindow(QWidget *parent)
10
: QMainWindow(parent)
11
{
12
//! [0]
13
}
14
15
void
MainWindow
::
setupContents
()
16
{
17
QToolBar *fileToolbar;
18
19
//! [1]
20
fileToolbar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
21
addToolBar(Qt::TopToolBarArea, fileToolbar);
22
//! [1]
23
24
25
//! [2]
26
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
27
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
28
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
29
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
30
//! [2]
31
32
33
//! [3]
34
QWidget
*centralWidget =
new
QWidget(
this
);
35
setCentralWidget(centralWidget);
36
//! [3]
37
}
MainWindow
[6]
Definition
src_corelib_kernel_qmetaobject.cpp:74
MainWindow::setupContents
void setupContents()
Definition
doc_src_qt4-mainwindow.cpp:15
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:432
qtbase
src
widgets
doc
snippets
code
doc_src_qt4-mainwindow.cpp
Generated on
for Qt by
1.18.0