Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_tools_qsize.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
5
QSize
t1
(10, 12);
6
t1
.scale(60, 60,
Qt::IgnoreAspectRatio
);
7
// t1 is (60, 60)
8
9
QSize
t2
(10, 12);
10
t2
.
scale
(60, 60,
Qt::KeepAspectRatio
);
11
// t2 is (50, 60)
12
13
QSize
t3
(10, 12);
14
t3
.
scale
(60, 60,
Qt::KeepAspectRatioByExpanding
);
15
// t3 is (60, 72)
17
18
20
QSize
size
(100, 10);
21
size
.rwidth() += 20;
22
23
// size becomes (120,10)
25
26
28
QSize
size
(100, 10);
29
size
.rheight() += 5;
30
31
// size becomes (100,15)
33
34
36
QSize
s
( 3, 7);
37
QSize
r
(-1, 4);
38
s
+=
r
;
39
40
// s becomes (2,11)
42
43
45
QSize
s
( 3, 7);
46
QSize
r
(-1, 4);
47
s
-=
r
;
48
49
// s becomes (4,3)
51
52
54
QSizeF
t1
(10, 12);
55
t1
.scale(60, 60,
Qt::IgnoreAspectRatio
);
56
// t1 is (60, 60)
57
58
QSizeF
t2
(10, 12);
59
t2
.
scale
(60, 60,
Qt::KeepAspectRatio
);
60
// t2 is (50, 60)
61
62
QSizeF
t3
(10, 12);
63
t3
.
scale
(60, 60,
Qt::KeepAspectRatioByExpanding
);
64
// t3 is (60, 72)
66
67
69
QSizeF
size
(100.3, 10);
70
size
.rwidth() += 20.5;
71
72
// size becomes (120.8,10)
74
75
77
QSizeF
size
(100, 10.2);
78
size
.rheight() += 5.5;
79
80
// size becomes (100,15.7)
82
83
85
QSizeF
s
( 3, 7);
86
QSizeF
r
(-1, 4);
87
s
+=
r
;
88
89
// s becomes (2,11)
91
92
94
QSizeF
s
( 3, 7);
95
QSizeF
r
(-1, 4);
96
s
-=
r
;
97
98
// s becomes (4,3)
QSizeF
\inmodule QtCore
Definition
qsize.h:208
QSize
\inmodule QtCore
Definition
qsize.h:25
QSize::scale
void scale(int w, int h, Qt::AspectRatioMode mode) noexcept
Scales the size to a rectangle with the given width and height, according to the specified mode:
Definition
qsize.h:145
Qt::KeepAspectRatioByExpanding
@ KeepAspectRatioByExpanding
Definition
qnamespace.h:1193
Qt::KeepAspectRatio
@ KeepAspectRatio
Definition
qnamespace.h:1192
Qt::IgnoreAspectRatio
@ IgnoreAspectRatio
Definition
qnamespace.h:1191
size
GLenum GLuint GLintptr GLsizeiptr size
[1]
Definition
qopengles2ext.h:660
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
Definition
qopengles2ext.h:2707
s
GLdouble s
[6]
Definition
qopenglext.h:235
t3
QSize t3(10, 12)
r
QSize r(-1, 4)
t1
QSize t1(10, 12)
[0]
size
QSize size(100, 10)
[0]
t2
QSize t2(10, 12)
s
QSize s(3, 7)
[2]
Definition
src_corelib_tools_qsize.cpp:38
qtbase
src
corelib
doc
snippets
code
src_corelib_tools_qsize.cpp
Generated by
1.10.0