C
SafeRenderer::QSafeRect Struct
struct SafeRenderer::QSafeRectThe QSafeRect class defines a rectangle in the plane. More...
Header: | #include <QSafeRect> |
Since: | QtSafeRenderer 2.0 |
Public Functions
QSafeRect(const SafeRenderer::QSafePoint &topLeftArg, const SafeRenderer::QSafeSize &sizeArg) | |
QSafeRect(const SafeRenderer::qint32 xArg, const SafeRenderer::qint32 yArg, const SafeRenderer::qint32 widthArg, const SafeRenderer::qint32 heightArg) | |
SafeRenderer::qint32 | height() const |
void | reset() |
void | setHeight(const SafeRenderer::qint32 heightArg) |
void | setWidth(const SafeRenderer::qint32 widthArg) |
void | setX(const SafeRenderer::qint32 xArg) |
void | setY(const SafeRenderer::qint32 yArg) |
SafeRenderer::qint32 | width() const |
SafeRenderer::qint32 | x() const |
SafeRenderer::qint32 | y() const |
Static Public Members
bool | equals(const SafeRenderer::QSafeRect &a, const SafeRenderer::QSafeRect &b) |
bool | intersects(const SafeRenderer::QSafeRect &a, const SafeRenderer::QSafeRect &b) |
SafeRenderer::QSafeRect | united(const SafeRenderer::QSafeRect &a, const SafeRenderer::QSafeRect &b) |
Detailed Description
The QSafeRect class holds the x, y, height and width variables. The QSafeRect class also provides the intersects() function which returns true if two rectangles intersects, and the united() function which returns the rectangle that encloses the two given rectangles.
Member Function Documentation
[explicit]
QSafeRect::QSafeRect(const SafeRenderer::QSafePoint &topLeftArg, const SafeRenderer::QSafeSize &sizeArg)
Constructs a rectangle with the given topLeftArg and sizeArg.
[explicit]
QSafeRect::QSafeRect(const SafeRenderer::qint32 xArg, const SafeRenderer::qint32 yArg, const SafeRenderer::qint32 widthArg, const SafeRenderer::qint32 heightArg)
Constructs a rectangle with (xArg, yArg) as its top-left corner and the given size widthArg and heightArg.
[static]
bool QSafeRect::equals(const SafeRenderer::QSafeRect &a, const SafeRenderer::QSafeRect &b)
Returns true if the rectangles a and b are equal, otherwise returns false.
SafeRenderer::qint32 QSafeRect::height() const
Returns the height value.
See also setHeight().
[static]
bool QSafeRect::intersects(const SafeRenderer::QSafeRect &a, const SafeRenderer::QSafeRect &b)
Returns true if the rectangle a intersects with the rectangle b (i.e., there is at least one pixel that is within both rectangles), otherwise returns false.
void QSafeRect::reset()
Resets the rect to default values.
void QSafeRect::setHeight(const SafeRenderer::qint32 heightArg)
Sets the height to heightArg.
See also height().
void QSafeRect::setWidth(const SafeRenderer::qint32 widthArg)
Sets the width to widthArg.
See also width().
void QSafeRect::setX(const SafeRenderer::qint32 xArg)
Sets the x to xArg.
See also x().
void QSafeRect::setY(const SafeRenderer::qint32 yArg)
Sets the y to yArg.
See also y().
[static]
SafeRenderer::QSafeRect QSafeRect::united(const SafeRenderer::QSafeRect &a, const SafeRenderer::QSafeRect &b)
Returns the bounding rectangle of the rectangle a and the rectangle b.
SafeRenderer::qint32 QSafeRect::width() const
Returns the width value.
See also setWidth().
SafeRenderer::qint32 QSafeRect::x() const
Returns the x value.
See also setX().
SafeRenderer::qint32 QSafeRect::y() const
Returns the y value.
See also setY().
Available under certain Qt licenses.
Find out more.