Eneboo - Documentación para desarrolladores
|
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>
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 |
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.
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 | ( | ) |
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.
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.
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.
QPointArray QCanvasPolygon::points | ( | ) | const |
int QCanvasPolygon::rtti | ( | ) | const [virtual] |
Returns 2 (QCanvasItem::Rtti_PolygonalItem).
Reimplementado de QCanvasPolygonalItem.
Reimplementado en QCanvasSpline y QCanvasSpline.
int QCanvasPolygon::rtti | ( | ) | const [virtual] |
Returns 4 (QCanvasItem::Rtti_Polygon).
Reimplementado de QCanvasPolygonalItem.
Reimplementado en QCanvasSpline y QCanvasSpline.
void QCanvasPolygon::setPoints | ( | QPointArray | pa | ) |
void QCanvasPolygon::setPoints | ( | QPointArray | ) |
QPointArray QCanvasPolygon::poly [protected] |
static int QCanvasPolygon::RTTI = Rtti_Polygon [static] |
Reimplementado de QCanvasPolygonalItem.
Reimplementado en QCanvasSpline.