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
src_gui_kernel_qwidget.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
//! [0]
5
w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);
6
//! [0]
7
8
9
//! [1]
10
w->setWindowState((w->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
11
//! [1]
12
13
14
//! [2]
15
width
= baseSize().width() + i * sizeIncrement().width();
16
height
= baseSize().height() + j * sizeIncrement().height();
17
//! [2]
18
19
20
//! [3]
21
aWidget->window()->setWindowTitle(
"New Window Title"
);
22
//! [3]
23
24
25
//! [6]
26
setCursor(Qt::IBeamCursor);
27
//! [6]
28
29
30
//! [7]
31
QPixmap
pixmap
(widget->size());
32
widget->render(&pixmap);
33
//! [7]
34
35
36
//! [8]
37
QPainter
painter
(
this
);
38
...
39
painter
.end();
40
myWidget->render(
this
);
41
//! [8]
42
43
44
//! [9]
45
setTabOrder
(
a
,
b
);
// a to b
46
setTabOrder
(
b
,
c
);
// a to b to c
47
setTabOrder
(
c
,
d
);
// a to b to c to d
48
//! [9]
49
50
51
//! [9.list]
52
setTabOrder
({a, b, c, d});
// a to b to c to d
53
//! [9.list]
54
55
56
//! [10]
57
// WRONG
58
setTabOrder
(
c
,
d
);
// c to d
59
setTabOrder
(
a
,
b
);
// a to b AND c to d
60
setTabOrder
(
b
,
c
);
// a to b to c, but not c to d
61
//! [10]
62
63
64
//! [11]
65
void
MyWidget::closeEvent(QCloseEvent *event)
66
{
67
QSettings settings(
"MyCompany"
,
"MyApp"
);
68
settings.setValue(
"geometry"
, saveGeometry());
69
QWidget::closeEvent(event);
70
}
71
//! [11]
72
73
74
//! [12]
75
QSettings
settings
(
"MyCompany"
,
"MyApp"
);
76
myWidget->restoreGeometry(settings.value(
"myWidget/geometry"
).toByteArray());
77
//! [12]
78
79
80
//! [13]
81
setUpdatesEnabled
(
false
);
82
bigVisualChanges
();
83
setUpdatesEnabled
(
true
);
84
//! [13]
setUpdatesEnabled
setUpdatesEnabled(false)
[12]
settings
QSettings settings("MyCompany", "MyApp")
[11]
setTabOrder
setTabOrder(a, b)
[8]
setTabOrder
setTabOrder({a, b, c, d})
[9]
painter
QPainter painter(this)
[7]
bigVisualChanges
bigVisualChanges()
pixmap
QPixmap pixmap(":/splash.png")
[0]
QImageData::height
int height
Definition
qimage_p.h:47
QImageData::width
int width
Definition
qimage_p.h:46
qtbase
src
widgets
doc
snippets
code
src_gui_kernel_qwidget.cpp
Generated on
for Qt by
1.18.0