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

The QCanvasEllipse class provides an ellipse or ellipse segment on a QCanvas.canvasA canvas item that paints an ellipse or ellipse segment with a QBrush. The ellipse's height, width, start angle and angle length can be set at construction time. The size can be changed at runtime with setSize(), and the angles can be changed (if you're displaying an ellipse segment rather than a whole ellipse) with setAngles(). Más...

#include <qcanvas.h>

Diagrama de herencias de QCanvasEllipse
QCanvasPolygonalItem QCanvasPolygonalItem QCanvasItem QCanvasItem QCanvasItem QCanvasItem Qt Qt Qt Qt Qt Qt Qt Qt

Lista de todos los miembros.

Métodos públicos

 QCanvasEllipse (QCanvas *canvas)
 QCanvasEllipse (int width, int height, QCanvas *canvas)
 QCanvasEllipse (int width, int height, int startangle, int angle, QCanvas *canvas)
 ~QCanvasEllipse ()
int width () const
int height () const
void setSize (int w, int h)
void setAngles (int start, int length)
int angleStart () const
int angleLength () const
QPointArray areaPoints () const
bool collidesWith (const QCanvasItem *) const
int rtti () const
 QCanvasEllipse (QCanvas *canvas)
 QCanvasEllipse (int width, int height, QCanvas *canvas)
 QCanvasEllipse (int width, int height, int startangle, int angle, QCanvas *canvas)
 ~QCanvasEllipse ()
int width () const
int height () const
void setSize (int w, int h)
void setAngles (int start, int length)
int angleStart () const
int angleLength () const
QPointArray areaPoints () const
bool collidesWith (const QCanvasItem *) const
int rtti () const

Atributos públicos estáticos

static int RTTI = Rtti_Ellipse

Métodos protegidos

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

Descripción detallada

The QCanvasEllipse class provides an ellipse or ellipse segment on a QCanvas.

canvas

A canvas item that paints an ellipse or ellipse segment with a QBrush. The ellipse's height, width, start angle and angle length can be set at construction time. The size can be changed at runtime with setSize(), and the angles can be changed (if you're displaying an ellipse segment rather than a whole ellipse) with setAngles().

Note that angles are specified in 16ths of a degree.

anglediagram qcanvasellipse.png Ellipse

If a start angle and length angle are set then an ellipse segment will be drawn. The start angle is the angle that goes from zero in a counter-clockwise direction (shown in green in the diagram). The length angle is the angle from the start angle in a counter-clockwise direction (shown in blue in the diagram). The blue segment is the segment of the ellipse that would be drawn. If no start angle and length angle are specified the entire ellipse is drawn.

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

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

Note: QCanvasEllipse does not use the pen.


Documentación del constructor y destructor

QCanvasEllipse::QCanvasEllipse ( QCanvas canvas)

Constructs a 32x32 ellipse, centered at (0, 0) on canvas.

QCanvasEllipse::QCanvasEllipse ( int  width,
int  height,
QCanvas canvas 
)

Constructs a width by height pixel ellipse, centered at (0, 0) on canvas.

QCanvasEllipse::QCanvasEllipse ( int  width,
int  height,
int  startangle,
int  angle,
QCanvas canvas 
)

Constructs a width by height pixel ellipse, centered at (0, 0) on canvas. Only a segment of the ellipse is drawn, starting at angle startangle, and extending for angle angle (the angle length).

Note that angles are specified in 1/16ths of a degree.

QCanvasEllipse::~QCanvasEllipse ( )

Destroys the ellipse.

QCanvasEllipse::QCanvasEllipse ( QCanvas canvas)
QCanvasEllipse::QCanvasEllipse ( int  width,
int  height,
QCanvas canvas 
)
QCanvasEllipse::QCanvasEllipse ( int  width,
int  height,
int  startangle,
int  angle,
QCanvas canvas 
)
QCanvasEllipse::~QCanvasEllipse ( )

Documentación de las funciones miembro

int QCanvasEllipse::angleLength ( ) const [inline]

Returns the length angle (the extent of the ellipse segment) in 16ths of a degree. Initially this will be 360 * 16 (a complete ellipse).

Ver también:
setAngles(), angleStart()
int QCanvasEllipse::angleLength ( ) const [inline]
int QCanvasEllipse::angleStart ( ) const [inline]

Returns the start angle in 16ths of a degree. Initially this will be 0.

Ver también:
setAngles(), angleLength()
int QCanvasEllipse::angleStart ( ) const [inline]
QPointArray QCanvasEllipse::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.

QPointArray QCanvasEllipse::areaPoints ( ) const [virtual]

Implementa QCanvasPolygonalItem.

bool QCanvasEllipse::collidesWith ( const QCanvasItem i) const [virtual]

Reimplementado de QCanvasPolygonalItem.

bool QCanvasEllipse::collidesWith ( const QCanvasItem i) const [virtual]

Reimplementado de QCanvasPolygonalItem.

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

Draws the ellipse, centered at x(), y() using the painter p.

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

Implementa QCanvasPolygonalItem.

void QCanvasEllipse::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.

int QCanvasEllipse::height ( ) const

Returns the height of the ellipse.

int QCanvasEllipse::height ( ) const
int QCanvasEllipse::rtti ( ) const [virtual]

Returns 2 (QCanvasItem::Rtti_PolygonalItem).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

int QCanvasEllipse::rtti ( ) const [virtual]

Returns 6 (QCanvasItem::Rtti_Ellipse).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

void QCanvasEllipse::setAngles ( int  start,
int  length 
)

Sets the angles for the ellipse. The start angle is start and the extent of the segment is length (the angle length) from the start. The angles are specified in 16ths of a degree. By default the ellipse will start at 0 and have an angle length of 360 * 16 (a complete ellipse).

Ver también:
angleStart(), angleLength()
void QCanvasEllipse::setAngles ( int  start,
int  length 
)
void QCanvasEllipse::setSize ( int  w,
int  h 
)
void QCanvasEllipse::setSize ( int  width,
int  height 
)

Sets the width and height of the ellipse.

int QCanvasEllipse::width ( ) const
int QCanvasEllipse::width ( ) const

Returns the width of the ellipse.


Documentación de los datos miembro

static int QCanvasEllipse::RTTI = Rtti_Ellipse [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'