1QCanvasRectangle(3qt)                                    QCanvasRectangle(3qt)
2
3
4

NAME

6       QCanvasRectangle - Rectangle on a QCanvas
7

SYNOPSIS

9       #include <qcanvas.h>
10
11       Inherits QCanvasPolygonalItem.
12
13   Public Members
14       QCanvasRectangle ( QCanvas * canvas )
15       QCanvasRectangle ( const QRect & r, QCanvas * canvas )
16       QCanvasRectangle ( int x, int y, int width, int height, QCanvas *
17           canvas )
18       ~QCanvasRectangle ()
19       int width () const
20       int height () const
21       void setSize ( int width, int height )
22       QSize size () const
23       QRect rect () const
24       virtual int rtti () const
25
26   Protected Members
27       virtual void drawShape ( QPainter & p )
28       virtual QPointArray chunks () const
29

DESCRIPTION

31       The QCanvasRectangle class provides a rectangle on a QCanvas.
32
33       This item paints a single rectangle which may have any pen() and
34       brush(), but may not be tilted/rotated. For rotated rectangles, use
35       QCanvasPolygon.
36
37       The rectangle's size and initial position can be set in the
38       constructor. The size can be set or changed later using setSize(). Use
39       height() and width() to retrieve the rectangle's dimensions.
40
41       The rectangle can be drawn on a painter with drawShape().
42
43       Like any other canvas item rectangles can be moved with
44       QCanvasItem::move() and QCanvasItem::moveBy(), or by setting
45       coordinates with QCanvasItem::setX(), QCanvasItem::setY() and
46       QCanvasItem::setZ().
47
48       See also Graphics Classes and Image Processing Classes.
49

MEMBER FUNCTION DOCUMENTATION

QCanvasRectangle::QCanvasRectangle ( QCanvas * canvas )

52       Constructs a rectangle at position (0,0) with both width and height set
53       to 32 pixels on canvas.
54

QCanvasRectangle::QCanvasRectangle ( const QRect & r, QCanvas * canvas )

56       Constructs a rectangle positioned and sized by r on canvas.
57

QCanvasRectangle::QCanvasRectangle ( int x, int y, int width, int height,

59       QCanvas * canvas )
60       Constructs a rectangle at position (x, y) and size width by height, on
61       canvas.
62

QCanvasRectangle::~QCanvasRectangle ()

64       Destroys the rectangle.
65

QPointArray QCanvasRectangle::chunks () const [virtual protected]

67       Simply calls QCanvasItem::chunks().
68

void QCanvasRectangle::drawShape ( QPainter & p ) [virtual protected]

70       Draws the rectangle on painter p.
71
72       Example: canvas/canvas.cpp.
73
74       Reimplemented from QCanvasPolygonalItem.
75

int QCanvasRectangle::height () const

77       Returns the height of the rectangle.
78

QRect QCanvasRectangle::rect () const

80       Returns the integer-converted x(), y() position and size() of the
81       rectangle as a QRect.
82

int QCanvasRectangle::rtti () const [virtual]

84       Returns 5 (QCanvasItem::Rtti_Rectangle).
85
86       See also QCanvasItem::rtti().
87
88       Reimplemented from QCanvasPolygonalItem.
89

void QCanvasRectangle::setSize ( int width, int height )

91       Sets the width and height of the rectangle.
92

QSize QCanvasRectangle::size () const

94       Returns the width() and height() of the rectangle.
95
96       See also rect() and setSize().
97

int QCanvasRectangle::width () const

99       Returns the width of the rectangle.
100
101

SEE ALSO

103       http://doc.trolltech.com/qcanvasrectangle.html
104       http://www.trolltech.com/faq/tech.html
105
107       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
108       license file included in the distribution for a complete license
109       statement.
110

AUTHOR

112       Generated automatically from the source code.
113

BUGS

115       If you find a bug in Qt, please report it as described in
116       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
117       help you. Thank you.
118
119       The definitive Qt documentation is provided in HTML format; it is
120       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
121       web browser. This man page is provided as a convenience for those users
122       who prefer man pages, although this format is not officially supported
123       by Trolltech.
124
125       If you find errors in this manual page, please report them to qt-
126       bugs@trolltech.com.  Please include the name of the manual page
127       (qcanvasrectangle.3qt) and the Qt version (3.3.8).
128
129
130
131Trolltech AS                    2 February 2007          QCanvasRectangle(3qt)
Impressum