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_gui_painting_qregion_unix.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#include <QRegion>
4
6
7void wrapper() {
9QRegion r1(10, 10, 20, 20);
10r1.isEmpty(); // false
11
12QRegion r3;
13r3.isEmpty(); // true
14
15QRegion r2(40, 40, 20, 20);
16r3 = r1.intersected(r2); // r3: intersection of r1 and r2
17r3.isEmpty(); // true
18
19r3 = r1.united(r2); // r3: union of r1 and r2
20r3.isEmpty(); // false
22
23} // wrapper
24} // src_gui_painting_qregion_unix
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
Definition qrect.h:167
QRect intersected(const QRect &other) const noexcept
Definition qrect.h:415
QRect united(const QRect &other) const noexcept
Definition qrect.h:420
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
QRect r1(100, 200, 11, 16)
[0]
QRect r2(QPoint(100, 200), QSize(11, 16))