Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_corelib_tools_qrect.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
<
QRect
>
5
#
include
<
QPoint
>
6
7
void
examples
()
8
{
9
{
10
//! [0]
11
QRect r1(100, 200, 11, 16);
12
QRect r2(QPoint(100, 200), QSize(11, 16));
13
//! [0]
14
}
15
16
{
17
//! [1]
18
QRectF r1(100.0, 200.1, 11.2, 16.3);
19
QRectF r2(QPointF(100.0, 200.1), QSizeF(11.2, 16.3));
20
//! [1]
21
}
22
23
{
24
//! [2]
25
QRect r = {15, 51, 42, 24};
26
r = r.transposed();
// r == {15, 51, 24, 42}
27
//! [2]
28
}
29
30
{
31
//! [3]
32
QRectF r = {1.5, 5.1, 4.2, 2.4};
33
r = r.transposed();
// r == {1.5, 5.1, 2.4, 4.2}
34
//! [3]
35
}
36
}
examples
bool examples()
[3]
Definition
src_corelib_global_qglobal.cpp:43
qtbase
src
corelib
doc
snippets
code
src_corelib_tools_qrect.cpp
Generated on
for Qt by
1.14.0