Qt
6.x
The Qt SDK
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Symbols
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Loading...
Searching...
No Matches
mdiareasnippets.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
void
mainWindowExample
()
7
{
8
QMdiArea
*mdiArea =
new
QMdiArea
;
10
QMainWindow
*mainWindow =
new
QMainWindow
;
11
mainWindow->setCentralWidget(mdiArea);
13
14
mdiArea->
addSubWindow
(
new
QPushButton
(
"Push Me Now!"
));
15
16
mainWindow->
show
();
17
}
18
19
void
addingSubWindowsExample
()
20
{
21
QWidget
*internalWidget1 =
new
QWidget
;
22
QWidget
*internalWidget2 =
new
QWidget
;
23
25
QMdiArea
mdiArea;
26
QMdiSubWindow
*subWindow1 =
new
QMdiSubWindow
;
27
subWindow1->
setWidget
(internalWidget1);
28
subWindow1->
setAttribute
(
Qt::WA_DeleteOnClose
);
29
mdiArea.
addSubWindow
(subWindow1);
30
31
QMdiSubWindow
*subWindow2 =
32
mdiArea.
addSubWindow
(internalWidget2);
33
35
subWindow1->
show
();
36
subWindow2->
show
();
37
38
mdiArea.show();
39
}
QMainWindow
The QMainWindow class provides a main application window.
Definition
qmainwindow.h:25
QMdiArea
The QMdiArea widget provides an area in which MDI windows are displayed.
Definition
qmdiarea.h:21
QMdiArea::addSubWindow
QMdiSubWindow * addSubWindow(QWidget *widget, Qt::WindowFlags flags=Qt::WindowFlags())
Adds widget as a new subwindow to the MDI area.
Definition
qmdiarea.cpp:1919
QMdiSubWindow
The QMdiSubWindow class provides a subwindow class for QMdiArea.
Definition
qmdisubwindow.h:20
QMdiSubWindow::setWidget
void setWidget(QWidget *widget)
Sets widget as the internal widget of this subwindow.
Definition
qmdisubwindow.cpp:2261
QPushButton
The QPushButton widget provides a command button.
Definition
qpushbutton.h:20
QWidget
The QWidget class is the base class of all user interface objects.
Definition
qwidget.h:99
QWidget::setAttribute
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition
qwidget.cpp:11244
QWidget::show
void show()
Shows the widget and its child widgets.
Definition
qwidget.cpp:7956
addingSubWindowsExample
void addingSubWindowsExample()
Definition
mdiareasnippets.cpp:19
mainWindowExample
void mainWindowExample()
Definition
mdiareasnippets.cpp:6
Qt::WA_DeleteOnClose
@ WA_DeleteOnClose
Definition
qnamespace.h:320
qtbase
src
widgets
doc
snippets
mdiarea
mdiareasnippets.cpp
Generated by
1.9.7