Skip to content

PythonQt.QtGui.QRegion · declarations 001

Back to PythonQt.QtGui.QRegion

Ellipse instance-attribute

Ellipse: Any

Rectangle instance-attribute

Rectangle: Any

RegionType instance-attribute

RegionType: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

boundingRect

boundingRect() -> Any

X.boundingRect() -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QRegion::boundingRect() const

Returns the bounding rectangle of this region. An empty region gives a rectangle that is QRect::isNull().

Upstream PySide2 reference signatures (binding differences may apply):

boundingRect(self) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#boundingRect

contains

contains(p: Any) -> bool

X.contains(p) -> bool

Supplemental documentation: Qt 5 reference:

bool QRegion::contains(const QPoint \&p) const

Returns true if the region contains the point p; otherwise returns false.

bool QRegion::contains(const QRect \&r) const

This is an overloaded function.

Returns true if the region overlaps the rectangle r; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

contains(self, p: PySide2.QtCore.QPoint) -> bool
contains(self, r: PySide2.QtCore.QRect) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#contains

intersected

intersected(r: Any) -> Any

X.intersected(r) -> PythonQt.QtGui.QRegion

Supplemental documentation: Qt 5 reference:

QRegion QRegion::intersected(const QRegion \&r) const

Returns a region which is the intersection of this region and r.

Region Intersection

The figure shows the intersection of two elliptical regions.

This function was introduced in Qt 4.2.

See also subtracted(), united(), and xored().

QRegion QRegion::intersected(const QRect \&rect) const

Returns a region which is the intersection of this region and the given rect.

This function was introduced in Qt 4.4.

See also subtracted(), united(), and xored().

Upstream PySide2 reference signatures (binding differences may apply):

intersected(self, r: PySide2.QtCore.QRect) -> PySide2.QtGui.QRegion
intersected(self, r: PySide2.QtGui.QRegion) -> PySide2.QtGui.QRegion

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#intersected

intersects

intersects(r: Any) -> bool

X.intersects(r) -> bool

Supplemental documentation: Qt 5 reference:

bool QRegion::intersects(const QRegion \&region) const

Returns true if this region intersects with region, otherwise returns false.

This function was introduced in Qt 4.2.

bool QRegion::intersects(const QRect \&rect) const

Returns true if this region intersects with rect, otherwise returns false.

This function was introduced in Qt 4.2.

Upstream PySide2 reference signatures (binding differences may apply):

intersects(self, r: PySide2.QtCore.QRect) -> bool
intersects(self, r: PySide2.QtGui.QRegion) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#intersects

isEmpty

isEmpty() -> bool

X.isEmpty() -> bool

Supplemental documentation: Qt 5 reference:

bool QRegion::isEmpty() const

Returns true if the region is empty; otherwise returns false. An empty region is a region that contains no points.

Example:

QRegion r1(10, 10, 20, 20);
r1.isEmpty();               // false

QRegion r3;
r3.isEmpty();               // true

QRegion r2(40, 40, 20, 20);
r3 = r1.intersected(r2);    // r3: intersection of r1 and r2
r3.isEmpty();               // true

r3 = r1.united(r2);         // r3: union of r1 and r2
r3.isEmpty();               // false

Upstream PySide2 reference signatures (binding differences may apply):

isEmpty(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#isEmpty

isNull

isNull() -> bool

X.isNull() -> bool

Supplemental documentation: Qt 5 reference:

bool QRegion::isNull() const

Returns true if the region is empty; otherwise returns false. An empty region is a region that contains no points. This function is the same as isEmpty

This function was introduced in Qt 5.0.

See also isEmpty().

Upstream PySide2 reference signatures (binding differences may apply):

isNull(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#isNull

rectCount

rectCount() -> int

X.rectCount() -> int

Supplemental documentation: Qt 5 reference:

int QRegion::rectCount() const

Returns the number of rectangles that this region is composed of. Same as end() - begin().

This function was introduced in Qt 4.6.

Upstream PySide2 reference signatures (binding differences may apply):

rectCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#rectCount

rects

rects() -> tuple

X.rects() -> tuple

Upstream PySide2 reference signatures (binding differences may apply):

rects(self) -> typing.List[PySide2.QtCore.QRect]

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#rects

setRects

setRects(rect: Any, num: int) -> None

X.setRects(rect, num)

Supplemental documentation: Qt 5 reference:

void QRegion::setRects(const QRect *rects, int number)

Sets the region using the array of rectangles specified by rects and number. The rectangles must be optimally Y-X sorted and follow these restrictions:

  • The rectangles must not intersect.
  • All rectangles with a given top coordinate must have the same height.
  • No two rectangles may abut horizontally (they should be combined into a single wider rectangle in that case).
  • The rectangles must be sorted in ascending order, with Y as the major sort key and X as the minor sort key.

See also rects().

Upstream PySide2 reference signatures (binding differences may apply):

setRects(self, rect: PySide2.QtCore.QRect, num: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#setRects

subtracted

subtracted(r: Any) -> Any

X.subtracted(r) -> PythonQt.QtGui.QRegion

Supplemental documentation: Qt 5 reference:

QRegion QRegion::subtracted(const QRegion \&r) const

Returns a region which is r subtracted from this region.

Region Subtraction

The figure shows the result when the ellipse on the right is subtracted from the ellipse on the left (left - right).

This function was introduced in Qt 4.2.

See also intersected(), united(), and xored().

Upstream PySide2 reference signatures (binding differences may apply):

subtracted(self, r: PySide2.QtGui.QRegion) -> PySide2.QtGui.QRegion

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#subtracted

swap

swap(other: Any) -> None

X.swap(other)

Supplemental documentation: Qt 5 reference:

void QRegion::swap(QRegion \&other)

Swaps region other with this region. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

Upstream PySide2 reference signatures (binding differences may apply):

swap(self, other: PySide2.QtGui.QRegion) -> None

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#swap

translate

translate(dx: Any, dy: Any) -> None

X.translate(dx, dy)

Supplemental documentation: Qt 5 reference:

void QRegion::translate(int dx, int dy)

Translates (moves) the region dx along the X axis and dy along the Y axis.

void QRegion::translate(const QPoint \&point)

This is an overloaded function.

Translates the region point.x() along the x axis and point.y() along the y axis, relative to the current position. Positive values move the region to the right and down.

Translates to the given point.

Upstream PySide2 reference signatures (binding differences may apply):

translate(self, dx: int, dy: int) -> None
translate(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#translate

translated

translated(dx: Any, dy: Any) -> Any

X.translated(dx, dy) -> PythonQt.QtGui.QRegion

Supplemental documentation: Qt 5 reference:

QRegion QRegion::translated(int dx, int dy) const

Returns a copy of the region that is translated dx along the x axis and dy along the y axis, relative to the current position. Positive values move the region to the right and down.

This function was introduced in Qt 4.1.

See also translate().

QRegion QRegion::translated(const QPoint \&p) const

This is an overloaded function.

Returns a copy of the regtion that is translated p.x() along the x axis and p.y() along the y axis, relative to the current position. Positive values move the rectangle to the right and down.

This function was introduced in Qt 4.1.

See also translate().

Upstream PySide2 reference signatures (binding differences may apply):

translated(self, dx: int, dy: int) -> PySide2.QtGui.QRegion
translated(self, p: PySide2.QtCore.QPoint) -> PySide2.QtGui.QRegion

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#translated

united

united(r: Any) -> Any

X.united(r) -> PythonQt.QtGui.QRegion

Supplemental documentation: Qt 5 reference:

QRegion QRegion::united(const QRegion \&r) const

Returns a region which is the union of this region and r.

Region Union

The figure shows the union of two elliptical regions.

This function was introduced in Qt 4.2.

See also intersected(), subtracted(), and xored().

QRegion QRegion::united(const QRect \&rect) const

Returns a region which is the union of this region and the given rect.

This function was introduced in Qt 4.4.

See also intersected(), subtracted(), and xored().

Upstream PySide2 reference signatures (binding differences may apply):

united(self, r: PySide2.QtCore.QRect) -> PySide2.QtGui.QRegion
united(self, r: PySide2.QtGui.QRegion) -> PySide2.QtGui.QRegion

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#united

xored

xored(r: Any) -> Any

X.xored(r) -> PythonQt.QtGui.QRegion

Supplemental documentation: Qt 5 reference:

QRegion QRegion::xored(const QRegion \&r) const

Returns a region which is the exclusive or (XOR) of this region and r.

Region XORed

The figure shows the exclusive or of two elliptical regions.

This function was introduced in Qt 4.2.

See also intersected(), united(), and subtracted().

Upstream PySide2 reference signatures (binding differences may apply):

xored(self, r: PySide2.QtGui.QRegion) -> PySide2.QtGui.QRegion

Source: https://doc.qt.io/archives/qt-5.15/qregion.html#xored