Eneboo - Documentación para desarrolladores
|
The QCanvasLine class provides a line on a QCanvas.canvasThe line inherits functionality from QCanvasPolygonalItem, for example the setPen() function. The start and end points of the line are set with setPoints(). Más...
#include <qcanvas.h>
Métodos públicos | |
QCanvasLine (QCanvas *canvas) | |
~QCanvasLine () | |
void | setPoints (int x1, int y1, int x2, int y2) |
QPoint | startPoint () const |
QPoint | endPoint () const |
int | rtti () const |
void | setPen (QPen p) |
void | moveBy (double dx, double dy) |
QCanvasLine (QCanvas *canvas) | |
~QCanvasLine () | |
void | setPoints (int x1, int y1, int x2, int y2) |
QPoint | startPoint () const |
QPoint | endPoint () const |
int | rtti () const |
void | setPen (QPen p) |
void | moveBy (double dx, double dy) |
Atributos públicos estáticos | |
static int | RTTI = Rtti_Line |
Métodos protegidos | |
void | drawShape (QPainter &) |
QPointArray | areaPoints () const |
void | drawShape (QPainter &) |
QPointArray | areaPoints () const |
The QCanvasLine class provides a line on a QCanvas.
canvas
The line inherits functionality from QCanvasPolygonalItem, for example the setPen() function. The start and end points of the line are set with setPoints().
Like any other canvas item lines can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
QCanvasLine::QCanvasLine | ( | QCanvas * | canvas | ) |
Constructs a line from (0,0) to (0,0) on canvas.
QCanvasLine::~QCanvasLine | ( | ) |
Destroys the line.
QCanvasLine::QCanvasLine | ( | QCanvas * | canvas | ) |
QCanvasLine::~QCanvasLine | ( | ) |
QPointArray QCanvasLine::areaPoints | ( | ) | const [protected, virtual] |
Note that the area defined by the line is somewhat thicker than the line that is actually drawn.
Implementa QCanvasPolygonalItem.
QPointArray QCanvasLine::areaPoints | ( | ) | const [protected, 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 QCanvasLine::drawShape | ( | QPainter & | p | ) | [protected, virtual] |
Implementa QCanvasPolygonalItem.
void QCanvasLine::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.
QPoint QCanvasLine::endPoint | ( | ) | const [inline] |
QPoint QCanvasLine::endPoint | ( | ) | const [inline] |
Returns the end point of the line.
void QCanvasLine::moveBy | ( | double | dx, |
double | dy | ||
) | [virtual] |
Reimplementado de QCanvasItem.
void QCanvasLine::moveBy | ( | double | dx, |
double | dy | ||
) | [virtual] |
Moves the canvas item relative to its current position by (dx, dy).
Reimplementado de QCanvasItem.
int QCanvasLine::rtti | ( | ) | const [virtual] |
Returns 7 (QCanvasItem::Rtti_Line).
Reimplementado de QCanvasPolygonalItem.
int QCanvasLine::rtti | ( | ) | const [virtual] |
Returns 2 (QCanvasItem::Rtti_PolygonalItem).
Reimplementado de QCanvasPolygonalItem.
void QCanvasLine::setPen | ( | QPen | p | ) | [virtual] |
Reimplementado de QCanvasPolygonalItem.
void QCanvasLine::setPen | ( | QPen | p | ) | [virtual] |
Sets the QPen used when drawing the item to the pen p. Note that many QCanvasPolygonalItems do not use the pen value.
Reimplementado de QCanvasPolygonalItem.
Sets the line's start point to (xa, ya) and its end point to (xb, yb).
QPoint QCanvasLine::startPoint | ( | ) | const [inline] |
QPoint QCanvasLine::startPoint | ( | ) | const [inline] |
Returns the start point of the line.
static int QCanvasLine::RTTI = Rtti_Line [static] |
Reimplementado de QCanvasPolygonalItem.