Skip to content

PythonQt.QtCore.QRect · declarations 001

Back to PythonQt.QtCore.QRect

adjust

adjust(x1: int, y1: int, x2: int, y2: int) -> None

X.adjust(x1, y1, x2, y2)

Supplemental documentation: Qt 5 reference:

void QRect::adjust(int dx1, int dy1, int dx2, int dy2)

Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.

See also adjusted() and setRect().

Upstream PySide2 reference signatures (binding differences may apply):

adjust(self, x1: int, y1: int, x2: int, y2: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#adjust

adjusted

adjusted(x1: int, y1: int, x2: int, y2: int) -> Any

X.adjusted(x1, y1, x2, y2) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QRect::adjusted(int dx1, int dy1, int dx2, int dy2) const

Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of this rectangle.

See also adjust().

Upstream PySide2 reference signatures (binding differences may apply):

adjusted(self, x1: int, y1: int, x2: int, y2: int) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#adjusted

bottom

bottom() -> int

X.bottom() -> int

Supplemental documentation: Qt 5 reference:

int QRect::bottom() const

Returns the y-coordinate of the rectangle's bottom edge.

Note that for historical reasons this function returns top() + height() - 1; use y() + height() to retrieve the true y-coordinate.

See also setBottom(), bottomLeft(), and bottomRight().

Upstream PySide2 reference signatures (binding differences may apply):

bottom(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#bottom

bottomLeft

bottomLeft() -> Any

X.bottomLeft() -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

QPoint QRect::bottomLeft() const

Returns the position of the rectangle's bottom-left corner. Note that for historical reasons this function returns QPoint(left(), top() + height() - 1).

See also setBottomLeft(), bottom(), and left().

Upstream PySide2 reference signatures (binding differences may apply):

bottomLeft(self) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#bottomLeft

bottomRight

bottomRight() -> Any

X.bottomRight() -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

QPoint QRect::bottomRight() const

Returns the position of the rectangle's bottom-right corner.

Note that for historical reasons this function returns QPoint(left() + width() -1, top() + height() - 1).

See also setBottomRight(), bottom(), and right().

Upstream PySide2 reference signatures (binding differences may apply):

bottomRight(self) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#bottomRight

center

center() -> Any

X.center() -> PythonQt.QtCore.QPoint

Supplemental documentation: Qt 5 reference:

QPoint QRect::center() const

Returns the center point of the rectangle.

See also moveCenter().

Upstream PySide2 reference signatures (binding differences may apply):

center(self) -> PySide2.QtCore.QPoint

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#center

contains

contains(x: Any, y: Any, proper: Any) -> bool

X.contains(x, y, proper) -> bool

Supplemental documentation: Qt 5 reference:

bool QRect::contains(const QPoint \&point, bool proper \= false) const

Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false. If proper is true, this function only returns true if the given point is inside the rectangle (i.e., not on the edge).

See also intersects().

bool QRect::contains(const QRect \&rectangle, bool proper \= false) const

This is an overloaded function.

Returns true if the given rectangle is inside this rectangle. otherwise returns false. If proper is true, this function only returns true if the rectangle is entirely inside this rectangle (not on the edge).

bool QRect::contains(int x, int y) const

This is an overloaded function.

Returns true if the point (x, y) is inside this rectangle, otherwise returns false.

bool QRect::contains(int x, int y, bool proper) const

This is an overloaded function.

Returns true if the point (x, y) is inside or on the edge of the rectangle, otherwise returns false. If proper is true, this function only returns true if the point is entirely inside the rectangle(not on the edge).

Upstream PySide2 reference signatures (binding differences may apply):

contains(self, p: PySide2.QtCore.QPoint, proper: bool=...) -> bool
contains(self, r: PySide2.QtCore.QRect, proper: bool=...) -> bool
contains(self, x: int, y: int) -> bool
contains(self, x: int, y: int, proper: bool) -> bool

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

height

height() -> int

X.height() -> int

Supplemental documentation: Qt 5 reference:

int QRect::height() const

Returns the height of the rectangle.

See also setHeight(), width(), and size().

Upstream PySide2 reference signatures (binding differences may apply):

height(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#height

intersected

intersected(other: Any) -> Any

X.intersected(other) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QRect::intersected(const QRect \&rectangle) const

Returns the intersection of this rectangle and the given rectangle. Note that r.intersected(s) is equivalent to r & s.

This function was introduced in Qt 4.2.

See also intersects(), united(), and operator\&\=().

Upstream PySide2 reference signatures (binding differences may apply):

intersected(self, other: PySide2.QtCore.QRect) -> PySide2.QtCore.QRect

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

intersects

intersects(r: Any) -> bool

X.intersects(r) -> bool

Supplemental documentation: Qt 5 reference:

bool QRect::intersects(const QRect \&rectangle) const

Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel that is within both rectangles), otherwise returns false.

The intersection rectangle can be retrieved using the intersected() function.

See also contains().

Upstream PySide2 reference signatures (binding differences may apply):

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

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

isEmpty

isEmpty() -> bool

X.isEmpty() -> bool

Supplemental documentation: Qt 5 reference:

bool QRect::isEmpty() const

Returns true if the rectangle is empty, otherwise returns false.

An empty rectangle has a left() > right() or top() > bottom(). An empty rectangle is not valid (i.e., isEmpty() \=\= isValid()).

Use the normalized() function to retrieve a rectangle where the corners are swapped.

See also isNull(), isValid(), and normalized().

Upstream PySide2 reference signatures (binding differences may apply):

isEmpty(self) -> bool

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

isNull

isNull() -> bool

X.isNull() -> bool

Supplemental documentation: Qt 5 reference:

bool QRect::isNull() const

Returns true if the rectangle is a null rectangle, otherwise returns false.

A null rectangle has both the width and the height set to 0 (i.e., right() \=\= left() - 1 and bottom() \=\= top() - 1). A null rectangle is also empty, and hence is not valid.

See also isEmpty() and isValid().

Upstream PySide2 reference signatures (binding differences may apply):

isNull(self) -> bool

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

isValid

isValid() -> bool

X.isValid() -> bool

Supplemental documentation: Qt 5 reference:

bool QRect::isValid() const

Returns true if the rectangle is valid, otherwise returns false.

A valid rectangle has a left() \<\= right() and top() \<\= bottom(). Note that non-trivial operations like intersections are not defined for invalid rectangles. A valid rectangle is not empty (i.e., isValid() \=\= isEmpty()).

See also isNull(), isEmpty(), and normalized().

Upstream PySide2 reference signatures (binding differences may apply):

isValid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#isValid

left

left() -> int

X.left() -> int

Supplemental documentation: Qt 5 reference:

int QRect::left() const

Returns the x-coordinate of the rectangle's left edge. Equivalent to x().

See also setLeft(), topLeft(), and bottomLeft().

Upstream PySide2 reference signatures (binding differences may apply):

left(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#left

marginsAdded

marginsAdded(margins: Any) -> Any

X.marginsAdded(margins) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QRect::marginsAdded(const QMargins \&margins) const

Returns a rectangle grown by the margins.

This function was introduced in Qt 5.1.

See also operator+\=(), marginsRemoved(), and operator-\=().

Upstream PySide2 reference signatures (binding differences may apply):

marginsAdded(self, margins: PySide2.QtCore.QMargins) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#marginsAdded

marginsRemoved

marginsRemoved(margins: Any) -> Any

X.marginsRemoved(margins) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QRect::marginsRemoved(const QMargins \&margins) const

Removes the margins from the rectangle, shrinking it.

This function was introduced in Qt 5.1.

See also marginsAdded(), operator+\=(), and operator-\=().

Upstream PySide2 reference signatures (binding differences may apply):

marginsRemoved(self, margins: PySide2.QtCore.QMargins) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#marginsRemoved

moveBottom

moveBottom(pos: int) -> None

X.moveBottom(pos)

Supplemental documentation: Qt 5 reference:

void QRect::moveBottom(int y)

Moves the rectangle vertically, leaving the rectangle's bottom edge at the given y coordinate. The rectangle's size is unchanged.

See also bottom(), setBottom(), and moveTop().

Upstream PySide2 reference signatures (binding differences may apply):

moveBottom(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveBottom

moveBottomLeft

moveBottomLeft(p: Any) -> None

X.moveBottomLeft(p)

Supplemental documentation: Qt 5 reference:

void QRect::moveBottomLeft(const QPoint \&position)

Moves the rectangle, leaving the bottom-left corner at the given position. The rectangle's size is unchanged.

See also setBottomLeft(), moveBottom(), and moveLeft().

Upstream PySide2 reference signatures (binding differences may apply):

moveBottomLeft(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveBottomLeft

moveBottomRight

moveBottomRight(p: Any) -> None

X.moveBottomRight(p)

Supplemental documentation: Qt 5 reference:

void QRect::moveBottomRight(const QPoint \&position)

Moves the rectangle, leaving the bottom-right corner at the given position. The rectangle's size is unchanged.

See also setBottomRight(), moveRight(), and moveBottom().

Upstream PySide2 reference signatures (binding differences may apply):

moveBottomRight(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveBottomRight

moveCenter

moveCenter(p: Any) -> None

X.moveCenter(p)

Supplemental documentation: Qt 5 reference:

void QRect::moveCenter(const QPoint \&position)

Moves the rectangle, leaving the center point at the given position. The rectangle's size is unchanged.

See also center().

Upstream PySide2 reference signatures (binding differences may apply):

moveCenter(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveCenter

moveLeft

moveLeft(pos: int) -> None

X.moveLeft(pos)

Supplemental documentation: Qt 5 reference:

void QRect::moveLeft(int x)

Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate. The rectangle's size is unchanged.

See also left(), setLeft(), and moveRight().

Upstream PySide2 reference signatures (binding differences may apply):

moveLeft(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveLeft

moveRight

moveRight(pos: int) -> None

X.moveRight(pos)

Supplemental documentation: Qt 5 reference:

void QRect::moveRight(int x)

Moves the rectangle horizontally, leaving the rectangle's right edge at the given x coordinate. The rectangle's size is unchanged.

See also right(), setRight(), and moveLeft().

Upstream PySide2 reference signatures (binding differences may apply):

moveRight(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveRight

moveTo

moveTo(x: Any, t: Any) -> None

X.moveTo(x, t)

Supplemental documentation: Qt 5 reference:

void QRect::moveTo(int x, int y)

Moves the rectangle, leaving the top-left corner at the given position (x, y). The rectangle's size is unchanged.

See also translate() and moveTopLeft().

void QRect::moveTo(const QPoint \&position)

Moves the rectangle, leaving the top-left corner at the given position.

Upstream PySide2 reference signatures (binding differences may apply):

moveTo(self, p: PySide2.QtCore.QPoint) -> None
moveTo(self, x: int, t: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveTo

moveTop

moveTop(pos: int) -> None

X.moveTop(pos)

Supplemental documentation: Qt 5 reference:

void QRect::moveTop(int y)

Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate. The rectangle's size is unchanged.

See also top(), setTop(), and moveBottom().

Upstream PySide2 reference signatures (binding differences may apply):

moveTop(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveTop

moveTopLeft

moveTopLeft(p: Any) -> None

X.moveTopLeft(p)

Supplemental documentation: Qt 5 reference:

void QRect::moveTopLeft(const QPoint \&position)

Moves the rectangle, leaving the top-left corner at the given position. The rectangle's size is unchanged.

See also setTopLeft(), moveTop(), and moveLeft().

Upstream PySide2 reference signatures (binding differences may apply):

moveTopLeft(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveTopLeft

moveTopRight

moveTopRight(p: Any) -> None

X.moveTopRight(p)

Supplemental documentation: Qt 5 reference:

void QRect::moveTopRight(const QPoint \&position)

Moves the rectangle, leaving the top-right corner at the given position. The rectangle's size is unchanged.

See also setTopRight(), moveTop(), and moveRight().

Upstream PySide2 reference signatures (binding differences may apply):

moveTopRight(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#moveTopRight

normalized

normalized() -> Any

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

Supplemental documentation: Qt 5 reference:

QRect QRect::normalized() const

Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.

If width() \< 0 the function swaps the left and right corners, and it swaps the top and bottom corners if height() \< 0.

See also isValid() and isEmpty().

Upstream PySide2 reference signatures (binding differences may apply):

normalized(self) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#normalized

right

right() -> int

X.right() -> int

Supplemental documentation: Qt 5 reference:

int QRect::right() const

Returns the x-coordinate of the rectangle's right edge.

Note that for historical reasons this function returns left() + width() - 1; use x() + width() to retrieve the true x-coordinate.

See also setRight(), topRight(), and bottomRight().

Upstream PySide2 reference signatures (binding differences may apply):

right(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#right

setBottom

setBottom(pos: int) -> None

X.setBottom(pos)

Supplemental documentation: Qt 5 reference:

void QRect::setBottom(int y)

Sets the bottom edge of the rectangle to the given y coordinate. May change the height, but will never change the top edge of the rectangle.

See also bottom() and moveBottom().

Upstream PySide2 reference signatures (binding differences may apply):

setBottom(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setBottom

setBottomLeft

setBottomLeft(p: Any) -> None

X.setBottomLeft(p)

Supplemental documentation: Qt 5 reference:

void QRect::setBottomLeft(const QPoint \&position)

Set the bottom-left corner of the rectangle to the given position. May change the size, but will never change the top-right corner of the rectangle.

See also bottomLeft() and moveBottomLeft().

Upstream PySide2 reference signatures (binding differences may apply):

setBottomLeft(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setBottomLeft

setBottomRight

setBottomRight(p: Any) -> None

X.setBottomRight(p)

Supplemental documentation: Qt 5 reference:

void QRect::setBottomRight(const QPoint \&position)

Set the bottom-right corner of the rectangle to the given position. May change the size, but will never change the top-left corner of the rectangle.

See also bottomRight() and moveBottomRight().

Upstream PySide2 reference signatures (binding differences may apply):

setBottomRight(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setBottomRight

setCoords

setCoords(x1: int, y1: int, x2: int, y2: int) -> None

X.setCoords(x1, y1, x2, y2)

Supplemental documentation: Qt 5 reference:

void QRect::setCoords(int x1, int y1, int x2, int y2)

Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).

See also getCoords() and setRect().

Upstream PySide2 reference signatures (binding differences may apply):

setCoords(self, x1: int, y1: int, x2: int, y2: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setCoords

setHeight

setHeight(h: int) -> None

X.setHeight(h)

Supplemental documentation: Qt 5 reference:

void QRect::setHeight(int height)

Sets the height of the rectangle to the given height. The bottom edge is changed, but not the top one.

See also height() and setSize().

Upstream PySide2 reference signatures (binding differences may apply):

setHeight(self, h: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setHeight

setLeft

setLeft(pos: int) -> None

X.setLeft(pos)

Supplemental documentation: Qt 5 reference:

void QRect::setLeft(int x)

Sets the left edge of the rectangle to the given x coordinate. May change the width, but will never change the right edge of the rectangle.

Equivalent to setX().

See also left() and moveLeft().

Upstream PySide2 reference signatures (binding differences may apply):

setLeft(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setLeft

setRect

setRect(x: int, y: int, w: int, h: int) -> None

X.setRect(x, y, w, h)

Supplemental documentation: Qt 5 reference:

void QRect::setRect(int x, int y, int width, int height)

Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.

See also getRect() and setCoords().

Upstream PySide2 reference signatures (binding differences may apply):

setRect(self, x: int, y: int, w: int, h: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setRect

setRight

setRight(pos: int) -> None

X.setRight(pos)

Supplemental documentation: Qt 5 reference:

void QRect::setRight(int x)

Sets the right edge of the rectangle to the given x coordinate. May change the width, but will never change the left edge of the rectangle.

See also right() and moveRight().

Upstream PySide2 reference signatures (binding differences may apply):

setRight(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setRight

setSize

setSize(s: Any) -> None

X.setSize(s)

Supplemental documentation: Qt 5 reference:

void QRect::setSize(const QSize \&size)

Sets the size of the rectangle to the given size. The top-left corner is not moved.

See also size(), setWidth(), and setHeight().

Upstream PySide2 reference signatures (binding differences may apply):

setSize(self, s: PySide2.QtCore.QSize) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setSize

setTop

setTop(pos: int) -> None

X.setTop(pos)

Supplemental documentation: Qt 5 reference:

void QRect::setTop(int y)

Sets the top edge of the rectangle to the given y coordinate. May change the height, but will never change the bottom edge of the rectangle.

Equivalent to setY().

See also top() and moveTop().

Upstream PySide2 reference signatures (binding differences may apply):

setTop(self, pos: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setTop

setTopLeft

setTopLeft(p: Any) -> None

X.setTopLeft(p)

Supplemental documentation: Qt 5 reference:

void QRect::setTopLeft(const QPoint \&position)

Set the top-left corner of the rectangle to the given position. May change the size, but will never change the bottom-right corner of the rectangle.

See also topLeft() and moveTopLeft().

Upstream PySide2 reference signatures (binding differences may apply):

setTopLeft(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setTopLeft

setTopRight

setTopRight(p: Any) -> None

X.setTopRight(p)

Supplemental documentation: Qt 5 reference:

void QRect::setTopRight(const QPoint \&position)

Set the top-right corner of the rectangle to the given position. May change the size, but will never change the bottom-left corner of the rectangle.

See also topRight() and moveTopRight().

Upstream PySide2 reference signatures (binding differences may apply):

setTopRight(self, p: PySide2.QtCore.QPoint) -> None

Source: https://doc.qt.io/archives/qt-5.15/qrect.html#setTopRight