C

QSafeRect Struct

struct SafeRenderer::QSafeRect

The QSafeRect class defines a rectangle in the plane. More...

Header: #include <QSafeRect>
Since: QtSafeRenderer 2.0

Public Functions

QSafeRect()
QSafeRect(const SafeRenderer::quint32 xArg, const SafeRenderer::quint32 yArg, const SafeRenderer::quint32 widthArg, const SafeRenderer::quint32 heightArg)
QSafeRect(const SafeRenderer::QSafePoint &topLeftArg, const SafeRenderer::QSafeSize &sizeArg)
SafeRenderer::quint32 height() const
void setHeight(const SafeRenderer::quint32 heightArg)
void setWidth(const SafeRenderer::quint32 widthArg)
void setX(const SafeRenderer::quint32 xArg)
void setY(const SafeRenderer::quint32 yArg)
SafeRenderer::quint32 width() const
SafeRenderer::quint32 x() const
SafeRenderer::quint32 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

QSafeRect::QSafeRect()

Constructs a default safe size object. The x, y, width and height values are set to 0.

QSafeRect::QSafeRect(const SafeRenderer::quint32 xArg, const SafeRenderer::quint32 yArg, const SafeRenderer::quint32 widthArg, const SafeRenderer::quint32 heightArg)

Constructs a rectangle with (xArg, yArg) as its top-left corner and the given widthArg and heightArg.

QSafeRect::QSafeRect(const SafeRenderer::QSafePoint &topLeftArg, const SafeRenderer::QSafeSize &sizeArg)

Constructs a rectangle with the given topLeftArg and sizeArg.

[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::quint32 QSafeRect::height() const

Returns the height.

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::setHeight(const SafeRenderer::quint32 heightArg)

Sets the height to heightArg.

See also height().

void QSafeRect::setWidth(const SafeRenderer::quint32 widthArg)

Sets the width to widthArg.

See also width().

void QSafeRect::setX(const SafeRenderer::quint32 xArg)

Sets the x to xArg.

See also x().

void QSafeRect::setY(const SafeRenderer::quint32 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::quint32 QSafeRect::width() const

Returns the width.

See also setWidth().

SafeRenderer::quint32 QSafeRect::x() const

Returns the x.

See also setX().

SafeRenderer::quint32 QSafeRect::y() const

Returns the y.

See also setY().

Available under certain Qt licenses.
Find out more.