![]() |
![]() |
The QtCanvasRectangle class provides a rectangle on a QtCanvas. More...
#include <QtCanvasRectangle>
Inherits QtCanvasPolygonalItem.
The QtCanvasRectangle class provides a rectangle on a QtCanvas.
This item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use QtCanvasPolygon.
The rectangle's size and initial position can be set in the constructor. The size can be set or changed later using setSize(). Use height() and width() to retrieve the rectangle's dimensions.
The rectangle can be drawn on a painter with drawShape().
Like any other canvas item rectangles can be moved with QtCanvasItem::move() and QtCanvasItem::moveBy(), or by setting coordinates with QtCanvasItem::setX(), QtCanvasItem::setY() and QtCanvasItem::setZ().
Constructs a rectangle at position (0,0) with both width and height set to 32 pixels on canvas.
Constructs a rectangle positioned and sized by r on canvas.
Constructs a rectangle at position (x, y) and size width by height, on canvas.
Destroys the rectangle.
Simply calls QtCanvasItem::chunks().
Draws the rectangle on painter p.
Reimplemented from QtCanvasPolygonalItem.
Returns the height of the rectangle.
Returns the integer-converted x(), y() position and size() of the rectangle as a QRect.
Returns 5 (QtCanvasItem::Rtti_Rectangle).
Reimplemented from QtCanvasItem.
See also QtCanvasItem::rtti().
Sets the width and height of the rectangle.
See also size().
Returns the width() and height() of the rectangle.
See also rect() and setSize().
Returns the width of the rectangle.
Copyright © 2005 Trolltech | Trademarks |