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
5QSize t1(10, 12);
6t1.scale(60, 60, Qt::IgnoreAspectRatio);
7// t1 is (60, 60)
8
9QSize t2(10, 12);
11// t2 is (50, 60)
12
13QSize t3(10, 12);
15// t3 is (60, 72)
17
18
20QSize size(100, 10);
21size.rwidth() += 20;
22
23// size becomes (120,10)
25
26
28QSize size(100, 10);
29size.rheight() += 5;
30
31// size becomes (100,15)
33
34
36QSize s( 3, 7);
37QSize r(-1, 4);
38s += r;
39
40// s becomes (2,11)
42
43
45QSize s( 3, 7);
46QSize r(-1, 4);
47s -= r;
48
49// s becomes (4,3)
51
52
54QSizeF t1(10, 12);
55t1.scale(60, 60, Qt::IgnoreAspectRatio);
56// t1 is (60, 60)
57
58QSizeF t2(10, 12);
60// t2 is (50, 60)
61
62QSizeF t3(10, 12);
64// t3 is (60, 72)
66
67
69QSizeF size(100.3, 10);
70size.rwidth() += 20.5;
71
72 // size becomes (120.8,10)
74
75
77QSizeF size(100, 10.2);
78size.rheight() += 5.5;
79
80// size becomes (100,15.7)
82
83
85QSizeF s( 3, 7);
86QSizeF r(-1, 4);
87s += r;
88
89// s becomes (2,11)
91
92
94QSizeF s( 3, 7);
95QSizeF r(-1, 4);
96s -= r;
97
98// s becomes (4,3)
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
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
@ KeepAspectRatioByExpanding
@ KeepAspectRatio
@ IgnoreAspectRatio
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
GLdouble s
[6]
Definition qopenglext.h:235
QSize t3(10, 12)
QSize r(-1, 4)
QSize t1(10, 12)
[0]
QSize size(100, 10)
[0]
QSize t2(10, 12)
QSize s(3, 7)
[2]