Qt Toolkit - QCanvasPolygon Class

| Classes - Annotated - Tree - Functions - Home - Structure

# QCanvasPolygon Class Reference
[ canvas module ]

A polygon with a movable reference point. More...

`#include <qcanvas.h>`

Inherits QCanvasPolygonalItem.

List of all member functions.

## Public Members

- QCanvasPolygon ( QCanvas * canvas )
- ~QCanvasPolygon ()
- void setPoints ( QPointArray )
- QPointArray points () const
- virtual QPointArray areaPoints () const
- virtual int rtti () const

## Protected Members

- virtual void drawShape ( QPainter & )

## Detailed Description

A polygon with a movable reference point.

Paints a polygon in a QBrush.

## Member Function Documentation

### QCanvasPolygon::QCanvasPolygon ( QCanvas * canvas )

Constructs a pointless polygon on canvas. You should call setPoints() before using it further.

### QCanvasPolygon::~QCanvasPolygon ()

Destructs the polygon.

### QPointArray QCanvasPolygon::areaPoints () const `[virtual]`

Returns the vertices of the polygon translated by the x(), y() position.

See also setPoints() and points().

Reimplemented from QCanvasPolygonalItem.

### void QCanvasPolygon::drawShape ( QPainter & p ) `[virtual protected]`

Note that QCanvasPolygon does not support an outline (pen is always NoPen).

Reimplemented from QCanvasPolygonalItem.

### void QCanvasPolygon::moveBy ( double dx, double dy ) `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QCanvasItem.

### QPointArray QCanvasPolygon::points () const

Returns the vertices of the polygon, not translated by the position.

See also setPoints() and areaPoints().

### int QCanvasPolygon::rtti () const `[virtual]`

Returns 4.

See also QCanvasItem::rtti().

Reimplemented from QCanvasItem.

### void QCanvasPolygon::setPoints ( QPointArray pa )

Sets the points of the polygon to be pa, which will be translated by x(), y() as the polygon is moved.

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):

This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.