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

The QCanvasRectangle class provides a rectangle on a QCanvas.canvasThis item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use QCanvasPolygon. Más...

#include <qcanvas.h>

Diagrama de herencias de QCanvasRectangle
QCanvasPolygonalItem QCanvasPolygonalItem QCanvasItem QCanvasItem QCanvasItem QCanvasItem Qt Qt Qt Qt Qt Qt Qt Qt

Lista de todos los miembros.

Métodos públicos

 QCanvasRectangle (QCanvas *canvas)
 QCanvasRectangle (const QRect &, QCanvas *canvas)
 QCanvasRectangle (int x, int y, int width, int height, QCanvas *canvas)
 ~QCanvasRectangle ()
int width () const
int height () const
void setSize (int w, int h)
QSize size () const
QPointArray areaPoints () const
QRect rect () const
bool collidesWith (const QCanvasItem *) const
int rtti () const
 QCanvasRectangle (QCanvas *canvas)
 QCanvasRectangle (const QRect &, QCanvas *canvas)
 QCanvasRectangle (int x, int y, int width, int height, QCanvas *canvas)
 ~QCanvasRectangle ()
int width () const
int height () const
void setSize (int w, int h)
QSize size () const
QPointArray areaPoints () const
QRect rect () const
bool collidesWith (const QCanvasItem *) const
int rtti () const

Atributos públicos estáticos

static int RTTI = Rtti_Rectangle

Métodos protegidos

void drawShape (QPainter &)
QPointArray chunks () const
void drawShape (QPainter &)
QPointArray chunks () const

Descripción detallada

The QCanvasRectangle class provides a rectangle on a QCanvas.

canvas

This item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use QCanvasPolygon.

The rectangle's size and initial position can be set in the constructor. The size can be set or changed later using setSize(). Use height() and width() to retrieve the rectangle's dimensions.

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

Like any other canvas item rectangles 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

QCanvasRectangle::QCanvasRectangle ( QCanvas canvas)

Constructs a rectangle at position (0,0) with both width and height set to 32 pixels on canvas.

QCanvasRectangle::QCanvasRectangle ( const QRect r,
QCanvas canvas 
)

Constructs a rectangle positioned and sized by r on canvas.

QCanvasRectangle::QCanvasRectangle ( int  x,
int  y,
int  width,
int  height,
QCanvas canvas 
)

Constructs a rectangle at position (x, y) and size width by height, on canvas.

QCanvasRectangle::~QCanvasRectangle ( )

Destroys the rectangle.

QCanvasRectangle::QCanvasRectangle ( QCanvas canvas)
QCanvasRectangle::QCanvasRectangle ( const QRect ,
QCanvas canvas 
)
QCanvasRectangle::QCanvasRectangle ( int  x,
int  y,
int  width,
int  height,
QCanvas canvas 
)
QCanvasRectangle::~QCanvasRectangle ( )

Documentación de las funciones miembro

QPointArray QCanvasRectangle::areaPoints ( ) const [virtual]

Implementa QCanvasPolygonalItem.

QPointArray QCanvasRectangle::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 QCanvasRectangle::chunks ( ) const [protected, virtual]

Simply calls QCanvasItem::chunks().

Reimplementado de QCanvasPolygonalItem.

QPointArray QCanvasRectangle::chunks ( ) const [protected, virtual]

Reimplementado de QCanvasPolygonalItem.

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

Reimplementado de QCanvasPolygonalItem.

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

Reimplementado de QCanvasPolygonalItem.

void QCanvasRectangle::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 QCanvasRectangle::drawShape ( QPainter p) [protected, virtual]

Draws the rectangle on painter p.

Implementa QCanvasPolygonalItem.

int QCanvasRectangle::height ( ) const

Returns the height of the rectangle.

int QCanvasRectangle::height ( ) const
QRect QCanvasRectangle::rect ( ) const [inline]
QRect QCanvasRectangle::rect ( ) const [inline]

Returns the integer-converted x(), y() position and size() of the rectangle as a QRect.

int QCanvasRectangle::rtti ( ) const [virtual]

Returns 2 (QCanvasItem::Rtti_PolygonalItem).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

int QCanvasRectangle::rtti ( ) const [virtual]

Returns 5 (QCanvasItem::Rtti_Rectangle).

Ver también:
QCanvasItem::rtti()

Reimplementado de QCanvasPolygonalItem.

void QCanvasRectangle::setSize ( int  w,
int  h 
)
void QCanvasRectangle::setSize ( int  width,
int  height 
)

Sets the width and height of the rectangle.

QSize QCanvasRectangle::size ( ) const [inline]
QSize QCanvasRectangle::size ( ) const [inline]

Returns the width() and height() of the rectangle.

Ver también:
rect(), setSize()
int QCanvasRectangle::width ( ) const

Returns the width of the rectangle.

int QCanvasRectangle::width ( ) const

Documentación de los datos miembro

static int QCanvasRectangle::RTTI = Rtti_Rectangle [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'