C
Qul::PlatformInterface::Rect Class
class Qul::PlatformInterface::RectRect 类使用整数精度在平面上定义了一个矩形。更多内容...
| Header: | #include <platforminterface/rect.h> |
| Since: | Qt Quick Ultralite (Platform) 1.5 |
公共函数
| Rect() | |
| Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Point &bottomRight) | |
| Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Size &size) | |
| Rect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t height) | |
| void | adjust(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2) |
| Qul::PlatformInterface::Rect | adjusted(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2) const |
| Qul::PlatformInterface::coord_t | bottom() const |
| Qul::PlatformInterface::Point | bottomLeft() const |
| Qul::PlatformInterface::Point | bottomRight() const |
| Qul::PlatformInterface::Point | center() const |
| bool | contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y) const |
| bool | contains(const Qul::PlatformInterface::Point &point, bool proper = false) const |
| bool | contains(const Qul::PlatformInterface::Rect &rectangle, bool proper = false) const |
| bool | contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, bool proper) const |
| void | getCoords(Qul::PlatformInterface::coord_t *x1, Qul::PlatformInterface::coord_t *y1, Qul::PlatformInterface::coord_t *x2, Qul::PlatformInterface::coord_t *y2) const |
| void | getRect(Qul::PlatformInterface::coord_t *x, Qul::PlatformInterface::coord_t *y, Qul::PlatformInterface::coord_t *width, Qul::PlatformInterface::coord_t *height) const |
| Qul::PlatformInterface::coord_t | height() const |
| Qul::PlatformInterface::Rect | intersected(const Qul::PlatformInterface::Rect &rectangle) const |
| bool | intersects(const Qul::PlatformInterface::Rect &rectangle) const |
| bool | isEmpty() const |
| bool | isNull() const |
| bool | isValid() const |
| Qul::PlatformInterface::coord_t | left() const |
| void | moveBottom(Qul::PlatformInterface::coord_t y) |
| void | moveBottomLeft(const Qul::PlatformInterface::Point &position) |
| void | moveBottomRight(const Qul::PlatformInterface::Point &position) |
| void | moveCenter(const Qul::PlatformInterface::Point &position) |
| void | moveLeft(Qul::PlatformInterface::coord_t x) |
| void | moveRight(Qul::PlatformInterface::coord_t x) |
| void | moveTo(const Qul::PlatformInterface::Point &position) |
| void | moveTo(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y) |
| void | moveTop(Qul::PlatformInterface::coord_t y) |
| void | moveTopLeft(const Qul::PlatformInterface::Point &position) |
| void | moveTopRight(const Qul::PlatformInterface::Point &position) |
| Qul::PlatformInterface::Rect | normalized() const |
| Qul::PlatformInterface::coord_t | right() const |
| void | setBottom(Qul::PlatformInterface::coord_t y) |
| void | setBottomLeft(const Qul::PlatformInterface::Point &position) |
| void | setBottomRight(const Qul::PlatformInterface::Point &position) |
| void | setCoords(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2) |
| void | setHeight(Qul::PlatformInterface::coord_t height) |
| void | setLeft(Qul::PlatformInterface::coord_t x) |
| void | setRect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t height) |
| void | setRight(Qul::PlatformInterface::coord_t x) |
| void | setSize(const Qul::PlatformInterface::Size &size) |
| void | setTop(Qul::PlatformInterface::coord_t y) |
| void | setTopLeft(const Qul::PlatformInterface::Point &position) |
| void | setTopRight(const Qul::PlatformInterface::Point &position) |
| void | setWidth(Qul::PlatformInterface::coord_t width) |
| void | setX(Qul::PlatformInterface::coord_t x) |
| void | setY(Qul::PlatformInterface::coord_t y) |
| Qul::PlatformInterface::Size | size() const |
| Qul::PlatformInterface::coord_t | top() const |
| Qul::PlatformInterface::Point | topLeft() const |
| Qul::PlatformInterface::Point | topRight() const |
| void | translate(const Qul::PlatformInterface::Point &offset) |
| void | translate(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy) |
| Qul::PlatformInterface::Rect | translated(const Qul::PlatformInterface::Point &offset) const |
| Qul::PlatformInterface::Rect | translated(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy) const |
| Qul::PlatformInterface::Rect | transposed() const |
| Qul::PlatformInterface::Rect | united(const Qul::PlatformInterface::Rect &rectangle) const |
| Qul::PlatformInterface::coord_t | width() const |
| Qul::PlatformInterface::coord_t | x() const |
| Qul::PlatformInterface::coord_t | y() const |
| Qul::PlatformInterface::Rect | operator&(const Qul::PlatformInterface::Rect &rectangle) const |
| Qul::PlatformInterface::Rect & | operator&=(const Qul::PlatformInterface::Rect &rectangle) |
| Qul::PlatformInterface::Rect | operator|(const Qul::PlatformInterface::Rect &rectangle) const |
| Qul::PlatformInterface::Rect & | operator|=(const Qul::PlatformInterface::Rect &rectangle) |
相关的非成员
| bool | operator!=(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2) |
| bool | operator==(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2) |
详细说明
矩形通常由左上角坐标和尺寸来表示。Rect 的尺寸(宽度和高度)始终与其渲染所依据的数学矩形相等。
Rect 可以通过一组左、上、宽和高的整数来构造,也可以通过一个 Point 和一个 Size 来构造。
还有第三种构造函数,它使用左上角和右下角的坐标来创建 Rect。
Rect 类提供了一组函数,这些函数返回各种矩形坐标,并允许对这些坐标进行操作。 Rect 还提供了用于相对于各种坐标移动矩形的函数。此外,还有moveTo() 函数,该函数在保持矩形左上角位于给定坐标不变的情况下移动矩形。另外,translate() 函数将矩形相对于当前位置移动给定的偏移量,而translated() 函数则返回该矩形的一个已平移的副本。
size() 函数返回矩形的尺寸,类型为 Size。也可以通过width() 和height() 函数分别获取各边尺寸。要操作尺寸,请使用setSize()、setWidth() 或setHeight() 函数。此外,还可以通过调用设置矩形坐标的函数(例如setBottom() 或setRight())来更改尺寸。
contains() 函数用于判断给定点是否位于矩形内部,而intersects() 函数若该矩形与给定矩形相交,则返回true 。Rect 类还提供了intersected() 函数,该函数返回相交矩形;以及united() 函数,该函数返回同时包含给定矩形和当前矩形的矩形:
当 `left()` > `right()` 或 `top()` > `bottom()` 时,`isEmpty()` 函数返回 `true `。请注意,空矩形是不合法的:当 `left()` <= `right()` 且 ` top()` <= `bottom()` 时,`isValid()` 函数返回 `true `。另一方面,空矩形(`isNull()` == true)的宽度和高度均设为 0。
请注意,由于 Rect 和RectF 的定义方式,空 Rect 的定义本质上与RectF 相同。
Rect 对象可以进行比较。
坐标
Rect 类提供了一组函数,这些函数返回各种矩形坐标,并允许对这些坐标进行操作。Rect 还提供了用于相对于各种坐标移动矩形的函数。
例如,left()、setLeft() 和moveLeft() 函数:left() 返回矩形左边缘的 x 坐标,setLeft() 将矩形的左边缘设置为给定的 x 坐标(这可能会改变宽度,但绝不会改变矩形的右边缘),而moveLeft() 则将整个矩形水平移动,同时保持矩形的左边缘位于给定的 x 坐标处且其尺寸不变。

为了与 Qt 兼容,bottom() 和right() 函数返回的值与矩形真正的右下角存在偏差:right() 函数返回 left() +width() - 1,而bottom() 函数返回top() +height() - 1。 bottomRight() 便捷函数返回的点也是如此。此外,topRight() 和bottomLeft() 函数的 x 和 y 坐标,分别包含与真实右边缘和底边缘相同的偏差。
我们建议您使用x() +width() 以及y() +height() 来查找真正的右下角,并避免使用right() 和bottom()。另一种解决方案是使用RectF :RectF 类使用浮点精度定义平面上的矩形坐标,而RectF::right() 和RectF::bottom() 函数确实会返回右侧和底部的坐标。
此外,还可以使用adjust()函数对该矩形的坐标添加偏移量,并可通过adjusted()函数根据对原始矩形的调整来获取新的矩形。如果宽度和高度中任一为负值,请使用normalized()函数来获取一个角落位置互换的矩形。
此外,Rect 还提供了getCoords() 函数,用于提取矩形左上角和右下角的位置;以及getRect() 函数,用于提取矩形的左上角、宽度和高度。使用setCoords() 和setRect() 函数可一次性操作矩形的坐标和尺寸。
限制
Rect 受限于coord_t 类型的最小值和最大值。对 Rect 进行的操作若可能导致值超出此范围,将产生未定义行为。
另请参阅 RectF 。
成员函数文档
Rect::Rect()
构建一个空矩形。
Rect::Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Point &bottomRight)
根据给定的topLeft 和bottomRight 构建一个矩形。
另请参阅 setTopLeft() 和setBottomRight()。
Rect::Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Size &size)
根据给定的topLeft 角和size ,构造一个矩形。
另请参阅 setTopLeft() 和setSize()。
Rect::Rect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t height)
构建一个矩形,其左上角坐标为 (x,y),边长分别为width 和height 。
另请参阅 setRect()。
void Rect::adjust(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2)
分别将x1 、y1 、x2 和y2 添加到矩形现有的坐标中。
Qul::PlatformInterface::Rect Rect::adjusted(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2) const
返回一个新的矩形,该矩形的现有坐标分别增加了x1 、y1 、x2 和y2 。
另请参阅 adjust()。
Qul::PlatformInterface::coord_t Rect::bottom() const
返回矩形底边的 y 坐标。
请注意,为了与 Qt XML 兼容,该函数返回的值为top() +height() - 1;若要获取真正的 y 坐标,请使用y() +height()。
另请参阅 setBottom()、bottomLeft() 和bottomRight()。
Qul::PlatformInterface::Point Rect::bottomLeft() const
返回矩形左下角的位置。请注意,出于历史原因,该函数返回 Point(left(),top() +height() - 1)。
另请参阅 setBottomLeft()、bottom() 和left()。
Qul::PlatformInterface::Point Rect::bottomRight() const
返回矩形右下角的位置。
请注意,为了与 Qt 兼容,该函数返回 Point(left() +width() - 1,top() +height() - 1)。
另请参阅 setBottomRight()、bottom() 和right()。
Qul::PlatformInterface::Point Rect::center() const
返回矩形的中心点。
另请参阅 moveCenter()。
bool Rect::contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y) const
如果点 (x,y) 位于该矩形内部,则返回true ;否则返回false 。
这是一个重载函数。
bool Rect::contains(const Qul::PlatformInterface::Point &point, bool proper = false) const
如果给定的point 位于矩形内部或边缘上,则返回true ;否则返回false 。如果proper 为真,则该函数仅在给定的point 位于矩形内部(即不在边缘上)时才返回true 。
这是一个重载函数。
另请参阅 intersects()。
bool Rect::contains(const Qul::PlatformInterface::Rect &rectangle, bool proper = false) const
如果给定的rectangle 位于该矩形内部,则返回true ;否则返回false 。如果proper 为真,则只有当rectangle 完全位于该矩形内部(且不在边界上)时,该函数才返回true 。
这是一个重载函数。
bool Rect::contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, bool proper) const
如果点 (x,y) 位于矩形内部或边上,则返回true ;否则返回false 。如果proper 为真,则该函数仅在点完全位于矩形内部(而非位于边上)时才返回true 。
这是一个重载函数。
void Rect::getCoords(Qul::PlatformInterface::coord_t *x1, Qul::PlatformInterface::coord_t *y1, Qul::PlatformInterface::coord_t *x2, Qul::PlatformInterface::coord_t *y2) const
将矩形左上角的位置提取到 *x1 和 *y1 ,将右下角的位置提取到 *x2 和 *y2 。
void Rect::getRect(Qul::PlatformInterface::coord_t *x, Qul::PlatformInterface::coord_t *y, Qul::PlatformInterface::coord_t *width, Qul::PlatformInterface::coord_t *height) const
将矩形左上角的位置提取到 *x 和 *y ,将其尺寸提取到 *width 和 *height 。
Qul::PlatformInterface::coord_t Rect::height() const
返回矩形的高度。
另请参阅 setHeight()、width() 和size()。
Qul::PlatformInterface::Rect Rect::intersected(const Qul::PlatformInterface::Rect &rectangle) const
返回该矩形与给定的rectangle 的交集。请注意,rectangle.intersected(s) 等同于r & s 。

另请参阅 intersects()、united() 和operator&=()。
bool Rect::intersects(const Qul::PlatformInterface::Rect &rectangle) const
如果该矩形与给定的rectangle 相交(即至少有一个像素同时位于两个矩形内),则返回true ;否则返回false 。
可使用intersected() 函数获取交集矩形。
另请参阅 contains()。
bool Rect::isEmpty() const
如果矩形为空,则返回true ;否则返回false 。
空矩形的left() >right() 或top() >bottom()。空矩形无效(即 isEmpty() == !isValid())。
使用normalized() 函数可获取一个四角已互换的矩形。
另请参阅 isNull()、isValid() 和normalized()。
bool Rect::isNull() const
如果该矩形为空矩形,则返回true ;否则返回false 。
空矩形的宽度和高度均设为 0(即right() ==left() - 1 且bottom() ==top() - 1)。空矩形也是空的,因此无效。
bool Rect::isValid() const
如果矩形有效,则返回true ;否则返回false 。
一个有效的矩形满足left() <=right() 且top() <=bottom()。请注意,对于无效的矩形,交集等非平凡操作未被定义。有效的矩形不为空(即 isValid() == !isEmpty())。
另请参阅 isNull()、isEmpty() 和normalized()。
Qul::PlatformInterface::coord_t Rect::left() const
返回矩形左边的 x 坐标。等同于x()。
另请参阅 setLeft()、topLeft() 和bottomLeft()。
void Rect::moveBottom(Qul::PlatformInterface::coord_t y)
将矩形沿垂直方向移动,同时保持矩形底边位于给定的y 坐标处。矩形的大小保持不变。
另请参阅 bottom()、setBottom() 和moveTop()。
void Rect::moveBottomLeft(const Qul::PlatformInterface::Point &position)
将矩形移动,使其左下角位于指定的坐标位置:position 。矩形的大小保持不变。
另请参阅 setBottomLeft()、moveBottom() 和moveLeft()。
void Rect::moveBottomRight(const Qul::PlatformInterface::Point &position)
将矩形移动,使其右下角位于给定的position 处。矩形的大小保持不变。
另请参阅 setBottomRight()、moveRight() 和moveBottom()。
void Rect::moveCenter(const Qul::PlatformInterface::Point &position)
将矩形移动,使其中心点位于给定的position 处。矩形的大小保持不变。
另请参阅 center()。
void Rect::moveLeft(Qul::PlatformInterface::coord_t x)
将矩形水平移动,同时保持矩形左边缘位于给定的x 坐标处。矩形的大小保持不变。
另请参阅 left()、setLeft() 和moveRight()。
void Rect::moveRight(Qul::PlatformInterface::coord_t x)
将矩形水平移动,同时保持矩形右边缘位于给定的x 坐标处。矩形的大小保持不变。
另请参阅 right()、setRight() 和moveLeft()。
void Rect::moveTo(const Qul::PlatformInterface::Point &position)
将矩形移动,使其左上角位于给定的position 处。
这是一个重载函数。
void Rect::moveTo(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y)
将矩形移动,同时将其左上角保持在给定位置(x ,y )。矩形的大小保持不变。
这是一个重载函数。
另请参阅 translate() 和moveTopLeft()。
void Rect::moveTop(Qul::PlatformInterface::coord_t y)
将矩形沿垂直方向移动,同时保持矩形顶边位于给定的y 坐标处。矩形的大小保持不变。
另请参阅 top()、setTop() 和moveBottom()。
void Rect::moveTopLeft(const Qul::PlatformInterface::Point &position)
将矩形移动,使其左上角位于给定的position 处。矩形的大小保持不变。
另请参阅 setTopLeft()、moveTop() 和moveLeft()。
void Rect::moveTopRight(const Qul::PlatformInterface::Point &position)
将矩形移动,使其右上角位于指定的position 处。矩形的大小保持不变。
另请参阅 setTopRight()、moveTop() 和moveRight()。
Qul::PlatformInterface::Rect Rect::normalized() const
返回一个归一化矩形;即,一个宽度和高度均为非负数的矩形。
如果 `width()` < 0,该函数会交换左右两角的位置;如果 `height()` < 0,则会交换上下两角的位置。
Qul::PlatformInterface::coord_t Rect::right() const
返回矩形右边的 x 坐标。
请注意,为了与 Qt XML 兼容,该函数返回的值是 `left()` + `width()` - 1;若要获取真正的 x 坐标,请使用 `x()` + `width()`。
另请参阅 setRight()、topRight() 和bottomRight()。
void Rect::setBottom(Qul::PlatformInterface::coord_t y)
将矩形的底部边缘设置为给定的y 坐标。可能会改变高度,但绝不会改变矩形的顶部边缘。
另请参阅 bottom() 和moveBottom()。
void Rect::setBottomLeft(const Qul::PlatformInterface::Point &position)
将矩形的左下角设置为给定的position 。可能会改变大小,但绝不会改变矩形的右上角。
另请参阅 bottomLeft() 和moveBottomLeft()。
void Rect::setBottomRight(const Qul::PlatformInterface::Point &position)
将矩形的右下角设置为给定的坐标position 。可能会改变矩形的大小,但绝不会改变其左上角的位置。
另请参阅 bottomRight() 和moveBottomRight()。
void Rect::setCoords(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2)
将矩形左上角的坐标设置为 (x1,y1),将其右下角的坐标设置为 (x2,y2)。
void Rect::setHeight(Qul::PlatformInterface::coord_t height)
将矩形的高度设置为指定的height 。底部边会发生变化,但顶部边保持不变。
void Rect::setLeft(Qul::PlatformInterface::coord_t x)
将矩形的左边缘设置为给定的x 坐标。可能会改变宽度,但绝不会改变矩形的右边缘。
等同于setX()。
void Rect::setRect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t height)
将矩形左上角的坐标设置为 (x,y),并将矩形大小设置为给定的width 和height 。
void Rect::setRight(Qul::PlatformInterface::coord_t x)
将矩形的右边边沿设置为给定的x 坐标。可能会改变宽度,但绝不会改变矩形的左边边沿。
void Rect::setSize(const Qul::PlatformInterface::Size &size)
将矩形的大小设置为给定的size 。左上角位置保持不变。
另请参阅 size()、setWidth() 以及setHeight()。
void Rect::setTop(Qul::PlatformInterface::coord_t y)
将矩形的顶边设置为给定的y 坐标。可能会改变高度,但绝不会改变矩形的底边。
等同于setY()。
void Rect::setTopLeft(const Qul::PlatformInterface::Point &position)
将矩形的左上角设置为给定的坐标position 。可能会改变矩形的大小,但绝不会改变其右下角的位置。
另请参阅 topLeft() 和moveTopLeft()。
void Rect::setTopRight(const Qul::PlatformInterface::Point &position)
将矩形的右上角设置为给定的position 。可能会改变尺寸,但绝不会改变矩形的左下角。
另请参阅 topRight() 和moveTopRight()。
void Rect::setWidth(Qul::PlatformInterface::coord_t width)
将矩形的宽度设置为给定的width 。右边缘会发生变化,但左边缘保持不变。
void Rect::setX(Qul::PlatformInterface::coord_t x)
将矩形的左边缘设置为给定的x 坐标。可能会改变宽度,但绝不会改变矩形的右边缘。
等同于setLeft()。
另请参阅 x()、setY() 和setTopLeft()。
void Rect::setY(Qul::PlatformInterface::coord_t y)
将矩形的顶边设置为给定的y 坐标。可能会改变高度,但绝不会改变矩形的底边。
等同于setTop()。
另请参阅 y()、setX() 和setTopLeft()。
Qul::PlatformInterface::Size Rect::size() const
返回矩形的大小。
另请参阅 setSize()、width() 和height()。
Qul::PlatformInterface::coord_t Rect::top() const
返回矩形顶边上的 y 坐标。等同于y()。
另请参阅 setTop()、topLeft() 和topRight()。
Qul::PlatformInterface::Point Rect::topLeft() const
返回矩形左上角的位置。
另请参阅 setTopLeft()、top() 和left()。
Qul::PlatformInterface::Point Rect::topRight() const
返回矩形右上角的位置。
请注意,为了与 Qt XML 兼容,该函数返回 Point(left() +width() -1,top())。
另请参阅 setTopRight()、top() 和right()。
void Rect::translate(const Qul::PlatformInterface::Point &offset)
将矩形offset.x()沿x轴移动,并沿y轴offset.y()移动,以当前位置为基准。
这是一个重载函数。
void Rect::translate(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy)
将矩形沿 x 轴移动dx ,沿 y 轴移动dy ,以当前位置为基准。正值会将矩形向右和向下移动。
这是一个重载函数。
另请参阅 moveTopLeft()、moveTo() 和translated()。
Qul::PlatformInterface::Rect Rect::translated(const Qul::PlatformInterface::Point &offset) const
返回一个矩形的副本,该矩形相对于当前位置沿 x 轴平移了offset 。x(),沿 y 轴平移了offset 。y()。
这是一个重载函数。
另请参阅 translate()。
Qul::PlatformInterface::Rect Rect::translated(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy) const
返回一个矩形副本,该矩形相对于当前位置沿 x 轴平移dx ,沿 y 轴平移dy 。正值会将矩形向右和向下移动。
这是一个重载函数。
另请参阅 translate()。
Qul::PlatformInterface::Rect Rect::transposed() const
返回一个矩形的副本,该副本的宽度和高度已被互换。
另请参阅 Qul::PlatformInterface::Size::transposed()。
Qul::PlatformInterface::Rect Rect::united(const Qul::PlatformInterface::Rect &rectangle) const
返回该矩形与给定的rectangle 的包围矩形。

另请参阅 intersected()。
Qul::PlatformInterface::coord_t Rect::width() const
返回矩形的宽度。
另请参阅 setWidth()、height()、以及size()。
Qul::PlatformInterface::coord_t Rect::x() const
返回矩形左边缘的 x 坐标。等同于left()。
Qul::PlatformInterface::coord_t Rect::y() const
返回矩形顶边上的 y 坐标。等同于top()。
Qul::PlatformInterface::Rect Rect::operator&(const Qul::PlatformInterface::Rect &rectangle) const
返回该矩形与给定的rectangle 的交集。若无交集,则返回一个空矩形。
另请参阅 operator&=()和intersected()。
Qul::PlatformInterface::Rect &Rect::operator&=(const Qul::PlatformInterface::Rect &rectangle)
求该矩形与给定的rectangle 的交集。
另请参阅 intersected() 和operator&()。
Qul::PlatformInterface::Rect Rect::operator|(const Qul::PlatformInterface::Rect &rectangle) const
返回该矩形与给定的rectangle 的包围矩形。
另请参阅 operator|=() 和united()。
Qul::PlatformInterface::Rect &Rect::operator|=(const Qul::PlatformInterface::Rect &rectangle)
将此矩形与给定的rectangle 合并。
相关的非成员
bool operator!=(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2)
如果矩形r1 和r2 不同,则返回true ;否则返回false 。
bool operator==(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2)
如果矩形r1 和r2 相等,则返回true ;否则返回false 。
在某些 Qt 许可证下可用。
了解更多信息。