Eneboo - Documentación para desarrolladores
Métodos públicos | Atributos públicos estáticos | Métodos protegidos | Atributos protegidos
Referencia de la Clase QCanvasPolygon

The QCanvasPolygon class provides a polygon on a QCanvas.canvasPaints a polygon with a QBrush. The polygon's points can be set in the constructor or set or changed later using setPoints(). Use points() to retrieve the points, or areaPoints() to retrieve the points relative to the canvas's origin. Más...

#include <qcanvas.h>

Diagrama de herencias de QCanvasPolygon
QCanvasPolygonalItem QCanvasPolygonalItem QCanvasItem QCanvasItem QCanvasItem QCanvasItem Qt Qt Qt Qt Qt Qt Qt Qt QCanvasSpline QCanvasSpline

Lista de todos los miembros.

Métodos públicos

 QCanvasPolygon (QCanvas *canvas)
 ~QCanvasPolygon ()
void setPoints (QPointArray)
QPointArray points () const
void moveBy (double dx, double dy)
QPointArray areaPoints () const
int rtti () const
 QCanvasPolygon (QCanvas *canvas)
 ~QCanvasPolygon ()
void setPoints (QPointArray)
QPointArray points () const
void moveBy (double dx, double dy)
QPointArray areaPoints () const
int rtti () const

Atributos públicos estáticos

static int RTTI = Rtti_Polygon

Métodos protegidos

void drawShape (QPainter &)
void drawShape (QPainter &)

Atributos protegidos

QPointArray poly

Descripción detallada

The QCanvasPolygon class provides a polygon on a QCanvas.

canvas

Paints a polygon with a QBrush. The polygon's points can be set in the constructor or set or changed later using setPoints(). Use points() to retrieve the points, or areaPoints() to retrieve the points relative to the canvas's origin.

The polygon can be drawn on a painter with drawShape().

Like any other canvas item polygons can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().

Note: QCanvasPolygon does not use the pen.


Documentación del constructor y destructor

QCanvasPolygon::QCanvasPolygon ( QCanvas canvas)

Constructs a point-less polygon on the canvas canvas. You should call setPoints() before using it further.

QCanvasPolygon::~QCanvasPolygon ( )

Destroys the polygon.

QCanvasPolygon::QCanvasPolygon ( QCanvas canvas)
QCanvasPolygon::~QCanvasPolygon ( )

Documentación de las funciones miembro

QPointArray QCanvasPolygon::areaPoints ( ) const [virtual]

Returns the vertices of the polygon translated by the polygon's current x(), y() position, i.e. relative to the canvas's origin.

Ver también:
setPoints(), points()

Implementa QCanvasPolygonalItem.

QPointArray QCanvasPolygon::areaPoints ( ) const [virtual]

This function must be reimplemented by subclasses. It must return the points bounding (i.e. outside and not touching) the shape or drawing errors will occur.

Implementa QCanvasPolygonalItem.

void QCanvasPolygon::drawShape ( QPainter p) [protected, virtual]

Draws the polygon using the painter p.

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

Implementa QCanvasPolygonalItem.

void QCanvasPolygon::drawShape ( QPainter p) [protected, virtual]

Subclasses must reimplement this function to draw their shape. The pen and brush of p are already set to pen() and brush() prior to calling this function.

Atención:
When you reimplement this function, make sure that you leave the painter in the same state as you found it. For example, if you start by calling QPainter::translate(50, 50), end your code by calling QPainter::translate(-50, -50). Be also aware that the painter might already have some transformations set (i.e., don't call QPainter::resetXForm() when you're done).
Ver también:
draw()

Implementa QCanvasPolygonalItem.

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

Moves the canvas item relative to its current position by (dx, dy).

Reimplementado de QCanvasItem.

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

Reimplementado de QCanvasItem.

QPointArray QCanvasPolygon::points ( ) const

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

Ver también:
setPoints(), areaPoints()
QPointArray QCanvasPolygon::points ( ) const
int QCanvasPolygon::rtti ( ) const [virtual]

Returns 2 (QCanvasItem::Rtti_PolygonalItem).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

Reimplementado en QCanvasSpline y QCanvasSpline.

int QCanvasPolygon::rtti ( ) const [virtual]

Returns 4 (QCanvasItem::Rtti_Polygon).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

Reimplementado en QCanvasSpline y QCanvasSpline.

void QCanvasPolygon::setPoints ( QPointArray  pa)

Sets the points of the polygon to be pa. These points will have their x and y coordinates automatically translated by x(), y() as the polygon is moved.

void QCanvasPolygon::setPoints ( QPointArray  )

Documentación de los datos miembro

static int QCanvasPolygon::RTTI = Rtti_Polygon [static]

Reimplementado de QCanvasPolygonalItem.

Reimplementado en QCanvasSpline.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'