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

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>

Diagrama de herencias de QCanvasLine
QCanvasPolygonalItem QCanvasPolygonalItem QCanvasItem QCanvasItem QCanvasItem QCanvasItem Qt Qt Qt Qt Qt Qt Qt Qt

Lista de todos los miembros.

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

Descripción detallada

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().


Documentación del constructor y destructor

QCanvasLine::QCanvasLine ( QCanvas canvas)

Constructs a line from (0,0) to (0,0) on canvas.

Ver también:
setPoints().
QCanvasLine::~QCanvasLine ( )

Destroys the line.

QCanvasLine::QCanvasLine ( QCanvas canvas)
QCanvasLine::~QCanvasLine ( )

Documentación de las funciones miembro

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.

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.

QPoint QCanvasLine::endPoint ( ) const [inline]
QPoint QCanvasLine::endPoint ( ) const [inline]

Returns the end point of the line.

Ver también:
setPoints(), startPoint()
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).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

int QCanvasLine::rtti ( ) const [virtual]

Returns 2 (QCanvasItem::Rtti_PolygonalItem).

Ver también:
QCanvasItem::rtti()

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.

Ver también:
setBrush(), pen(), drawShape()

Reimplementado de QCanvasPolygonalItem.

void QCanvasLine::setPoints ( int  x1,
int  y1,
int  x2,
int  y2 
)
void QCanvasLine::setPoints ( int  xa,
int  ya,
int  xb,
int  yb 
)

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.

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

Documentación de los datos miembro

static int QCanvasLine::RTTI = Rtti_Line [static]

Reimplementado de QCanvasPolygonalItem.


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'