C

Rect Class

class Qul::PlatformInterface::Rect

The Rect class defines a rectangle in the plane using integer precision. More...

Header: #include <platforminterface/rect.h>
Since: Qt Quick Ultralite (Platform) 1.5

Public Functions

Rect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t height)
Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Size &size)
Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Point &bottomRight)
Rect()
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(const Qul::PlatformInterface::Rect &rectangle, bool proper = false) const
bool contains(const Qul::PlatformInterface::Point &point, bool proper = false) const
bool contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y) 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(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y)
void moveTo(const Qul::PlatformInterface::Point &position)
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(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy)
void translate(const Qul::PlatformInterface::Point &offset)
Qul::PlatformInterface::Rect translated(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy) const
Qul::PlatformInterface::Rect translated(const Qul::PlatformInterface::Point &offset) 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)

Detailed Description

A rectangle is normally expressed as a top-left corner and a size. The size (width and height) of a Rect is always equivalent to the mathematical rectangle that forms the basis for its rendering.

A Rect can be constructed with a set of left, top, width and height integers, or from a Point and a Size.

There is a third constructor that creates a Rect using the top-left and bottom-right coordinates.

The Rect class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. Rect also provides functions to move the rectangle relative to the various coordinates. In addition there is a moveTo() function that moves the rectangle, leaving its top left corner at the given coordinates. Alternatively, the translate() function moves the rectangle the given offset relative to the current position, and the translated() function returns a translated copy of this rectangle.

The size() function returns the rectangle's dimensions as a Size. The dimensions can also be retrieved separately using the width() and height() functions. To manipulate the dimensions use the setSize(), setWidth() or setHeight() functions. Alternatively, the size can be changed by applying either of the functions setting the rectangle coordinates, for example, setBottom() or setRight().

The contains() function tells whether a given point is inside the rectangle or not, and the intersects() function returns true if this rectangle intersects with a given rectangle. The Rect class also provides the intersected() function which returns the intersection rectangle, and the united() function which returns the rectangle that encloses the given rectangle and this:

The isEmpty() function returns true if left() > right() or top() > bottom(). Note that an empty rectangle is not valid: The isValid() function returns true if left() <= right() and top() <= bottom(). A null rectangle (isNull() == true) on the other hand, has both width and height set to 0.

Note that due to the way Rect and RectF are defined, an empty Rect is defined in essentially the same way as RectF.

Rect objects can be compared.

Coordinates

The Rect class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. Rect also provides functions to move the rectangle relative to the various coordinates.

For example the left(), setLeft() and moveLeft() functions as an example: left() returns the x-coordinate of the rectangle's left edge, setLeft() sets the left edge of the rectangle to the given x coordinate (it may change the width, but will never change the rectangle's right edge) and moveLeft() moves the entire rectangle horizontally, leaving the rectangle's left edge at the given x coordinate and its size unchanged.

For compatibility with Qt, the values returned by the bottom() and right() functions deviate from the true bottom-right corner of the rectangle: The right() function returns left() + width() - 1 and the bottom() function returns top() + height() - 1. The same is the case for the point returned by the bottomRight() convenience function. In addition, the x and y coordinate of the topRight() and bottomLeft() functions, respectively, contain the same deviation from the true right and bottom edges.

We recommend that you use x() + width() and y() + height() to find the true bottom-right corner, and avoid right() and bottom(). Another solution is to use RectF: The RectF class defines a rectangle in the plane using floating point accuracy for coordinates, and the RectF::right() and RectF::bottom() functions do return the right and bottom coordinates.

It is also possible to add offsets to this rectangle's coordinates using the adjust() function, as well as retrieve a new rectangle based on adjustments of the original one using the adjusted() function. If either of the width and height is negative, use the normalized() function to retrieve a rectangle where the corners are swapped.

In addition, Rect provides the getCoords() function which extracts the position of the rectangle's top-left and bottom-right corner, and the getRect() function which extracts the rectangle's top-left corner, width and height. Use the setCoords() and setRect() function to manipulate the rectangle's coordinates and dimensions in one go.

Constraints

Rect is limited to the minimum and maximum values for the coord_t type. Operations on a Rect that could potentially result in values outside this range will result in undefined behavior.

See also RectF.

Member Function Documentation

Rect::Rect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t height)

Constructs a rectangle with (x, y) as its top-left corner and the given width and height.

See also setRect().

Rect::Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Size &size)

Constructs a rectangle with the given topLeft corner and the given size.

See also setTopLeft() and setSize().

Rect::Rect(const Qul::PlatformInterface::Point &topLeft, const Qul::PlatformInterface::Point &bottomRight)

Constructs a rectangle with the given topLeft and bottomRight corners.

See also setTopLeft() and setBottomRight().

Rect::Rect()

Constructs a null rectangle.

See also setRect() and isNull().

void Rect::adjust(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t y2)

Adds x1, y1, x2 and y2 respectively to the existing coordinates of the rectangle.

See also adjusted() and setRect().

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

Returns a new rectangle with x1, y1, x2 and y2 added respectively to the existing coordinates of this rectangle.

See also adjust().

Qul::PlatformInterface::coord_t Rect::bottom() const

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

Note that for compatibility with Qt, this function returns top() + height() - 1; use y() + height() to retrieve the true y-coordinate.

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

Qul::PlatformInterface::Point Rect::bottomLeft() const

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

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

Qul::PlatformInterface::Point Rect::bottomRight() const

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

Note that for compatibility with Qt, this function returns Point(left() + width() -1, top() + height() - 1).

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

Qul::PlatformInterface::Point Rect::center() const

Returns the center point of the rectangle.

See also moveCenter().

bool Rect::contains(const Qul::PlatformInterface::Rect &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 Rect::contains(const Qul::PlatformInterface::Point &point, bool proper = false) const

This is an overloaded function.

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 Rect::contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y) const

This is an overloaded function.

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

bool Rect::contains(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t 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).

void Rect::getCoords(Qul::PlatformInterface::coord_t *x1, Qul::PlatformInterface::coord_t *y1, Qul::PlatformInterface::coord_t *x2, Qul::PlatformInterface::coord_t *y2) const

Extracts the position of the rectangle's top-left corner to *x1 and *y1, and the position of the bottom-right corner to *x2 and *y2.

See also setCoords() and getRect().

void Rect::getRect(Qul::PlatformInterface::coord_t *x, Qul::PlatformInterface::coord_t *y, Qul::PlatformInterface::coord_t *width, Qul::PlatformInterface::coord_t *height) const

Extracts the position of the rectangle's top-left corner to *x and *y, and its dimensions to *width and *height.

See also setRect() and getCoords().

Qul::PlatformInterface::coord_t Rect::height() const

Returns the height of the rectangle.

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

Qul::PlatformInterface::Rect Rect::intersected(const Qul::PlatformInterface::Rect &rectangle) const

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

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

bool Rect::intersects(const Qul::PlatformInterface::Rect &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().

bool Rect::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().

bool Rect::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().

bool Rect::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().

Qul::PlatformInterface::coord_t Rect::left() const

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

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

void Rect::moveBottom(Qul::PlatformInterface::coord_t 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().

void Rect::moveBottomLeft(const Qul::PlatformInterface::Point &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().

void Rect::moveBottomRight(const Qul::PlatformInterface::Point &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().

void Rect::moveCenter(const Qul::PlatformInterface::Point &position)

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

See also center().

void Rect::moveLeft(Qul::PlatformInterface::coord_t 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().

void Rect::moveRight(Qul::PlatformInterface::coord_t 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().

void Rect::moveTo(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y)

This is an overloaded function.

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 Rect::moveTo(const Qul::PlatformInterface::Point &position)

This is an overloaded function.

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

void Rect::moveTop(Qul::PlatformInterface::coord_t 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().

void Rect::moveTopLeft(const Qul::PlatformInterface::Point &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().

void Rect::moveTopRight(const Qul::PlatformInterface::Point &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().

Qul::PlatformInterface::Rect Rect::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().

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

Note that for compatibility with Qt, this function returns left() + width() - 1; use x() + width() to retrieve the true x-coordinate.

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

void Rect::setBottom(Qul::PlatformInterface::coord_t 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().

void Rect::setBottomLeft(const Qul::PlatformInterface::Point &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().

void Rect::setBottomRight(const Qul::PlatformInterface::Point &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().

void Rect::setCoords(Qul::PlatformInterface::coord_t x1, Qul::PlatformInterface::coord_t y1, Qul::PlatformInterface::coord_t x2, Qul::PlatformInterface::coord_t 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().

void Rect::setHeight(Qul::PlatformInterface::coord_t 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().

void Rect::setLeft(Qul::PlatformInterface::coord_t 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().

void Rect::setRect(Qul::PlatformInterface::coord_t x, Qul::PlatformInterface::coord_t y, Qul::PlatformInterface::coord_t width, Qul::PlatformInterface::coord_t 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().

void Rect::setRight(Qul::PlatformInterface::coord_t 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().

void Rect::setSize(const Qul::PlatformInterface::Size &size)

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

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

void Rect::setTop(Qul::PlatformInterface::coord_t 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().

void Rect::setTopLeft(const Qul::PlatformInterface::Point &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().

void Rect::setTopRight(const Qul::PlatformInterface::Point &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().

void Rect::setWidth(Qul::PlatformInterface::coord_t width)

Sets the width of the rectangle to the given width. The right edge is changed, but not the left one.

See also width() and setSize().

void Rect::setX(Qul::PlatformInterface::coord_t 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 setLeft().

See also x(), setY(), and setTopLeft().

void Rect::setY(Qul::PlatformInterface::coord_t 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 setTop().

See also y(), setX(), and setTopLeft().

Qul::PlatformInterface::Size Rect::size() const

Returns the size of the rectangle.

See also setSize(), width(), and height().

Qul::PlatformInterface::coord_t Rect::top() const

Returns the y-coordinate of the rectangle's top edge. Equivalent to y().

See also setTop(), topLeft(), and topRight().

Qul::PlatformInterface::Point Rect::topLeft() const

Returns the position of the rectangle's top-left corner.

See also setTopLeft(), top(), and left().

Qul::PlatformInterface::Point Rect::topRight() const

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

Note that for compatibility with Qt, this function returns Point(left() + width() -1, top()).

See also setTopRight(), top(), and right().

void Rect::translate(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy)

This is an overloaded function.

Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position. Positive values move the rectangle to the right and down.

See also moveTopLeft(), moveTo(), and translated().

void Rect::translate(const Qul::PlatformInterface::Point &offset)

This is an overloaded function.

Moves the rectangle offset.x() along the x axis and offset.y() along the y axis, relative to the current position.

Qul::PlatformInterface::Rect Rect::translated(Qul::PlatformInterface::coord_t dx, Qul::PlatformInterface::coord_t dy) const

This is an overloaded function.

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

See also translate().

Qul::PlatformInterface::Rect Rect::translated(const Qul::PlatformInterface::Point &offset) const

This is an overloaded function.

Returns a copy of the rectangle that is translated offset.x() along the x axis and offset.y() along the y axis, relative to the current position.

See also translate().

Qul::PlatformInterface::Rect Rect::transposed() const

Returns a copy of the rectangle that has its width and height exchanged.

See also Qul::PlatformInterface::Size::transposed().

Qul::PlatformInterface::Rect Rect::united(const Qul::PlatformInterface::Rect &rectangle) const

Returns the bounding rectangle of this rectangle and the given rectangle.

See also intersected().

Qul::PlatformInterface::coord_t Rect::width() const

Returns the width of the rectangle.

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

Qul::PlatformInterface::coord_t Rect::x() const

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

See also setX(), y(), and topLeft().

Qul::PlatformInterface::coord_t Rect::y() const

Returns the y-coordinate of the rectangle's top edge. Equivalent to top().

See also setY(), x(), and topLeft().

Qul::PlatformInterface::Rect Rect::operator&(const Qul::PlatformInterface::Rect &rectangle) const

Returns the intersection of this rectangle and the given rectangle. Returns an empty rectangle if there is no intersection.

See also operator&=() and intersected().

Qul::PlatformInterface::Rect &Rect::operator&=(const Qul::PlatformInterface::Rect &rectangle)

Intersects this rectangle with the given rectangle.

See also intersected() and operator&().

Qul::PlatformInterface::Rect Rect::operator|(const Qul::PlatformInterface::Rect &rectangle) const

Returns the bounding rectangle of this rectangle and the given rectangle.

See also operator|=() and united().

Qul::PlatformInterface::Rect &Rect::operator|=(const Qul::PlatformInterface::Rect &rectangle)

Unites this rectangle with the given rectangle.

See also united() and operator|().

Related Non-Members

bool operator!=(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2)

Returns true if the rectangles r1 r2 are different, otherwise returns false.

bool operator==(const Qul::PlatformInterface::Rect &r1, const Qul::PlatformInterface::Rect &r2)

Returns true if the rectangles r1 r2 are equal, otherwise returns false.

Available under certain Qt licenses.
Find out more.