Eneboo - Documentación para desarrolladores
Slots públicos | Señales | Métodos públicos | Métodos protegidos | Propiedades
Referencia de la Clase PaintWidget

#include <quickpaintwidget.h>

Diagrama de herencias de PaintWidget
QWidget QObject QPaintDevice QObject QPaintDevice Qt Qt Qt Qt

Lista de todos los miembros.

Slots públicos

void setWindow (int x, int y, int w, int h)
void setClipRect (int x, int y, int w, int h)
void drawPoint (int x, int y)
void moveTo (int x, int y)
void lineTo (int x, int y)
void drawLine (int x1, int y1, int x2, int y2)
void drawRect (int x, int y, int w, int h)
void drawRoundRect (int x, int y, int w, int h, int xRnd, int yRnd)
void drawEllipse (int x, int y, int w, int h)
void drawArc (int x, int y, int w, int h, int a, int alen)
void drawPie (int x, int y, int w, int h, int a, int alen)
void drawChord (int x, int y, int w, int h, int a, int alen)
void fillRect (int x, int y, int w, int h)
void eraseRect (int x, int y, int w, int h)
void drawText (int x, int y, const QString &text)
int drawText (int x, int y, int w, int h, const QString &text, bool wordWrap)
void drawPixmap (int x, int y, const QPixmap &pixmap)
int textWidth (const QString &text)
int textHeight ()
int textAscent ()
int textDescent ()
void flush ()
void erase ()

Señales

void updateContents ()

Métodos públicos

 PaintWidget (QWidget *parent=0, const char *name=0)
 ~PaintWidget ()
void setPenColor (const QString &color)
void setBrushColor (const QString &color)
void setBackgroundColor (const QString &color)
void setPenWidth (int width)
QString penColor () const
QString brushColor () const
QString backgroundColorEx () const
int penWidth () const
void setFontFamily (const QString &family)
void setPointSize (int size)
QString fontFamily () const
int pointSize () const
void setPaletteBackgroundColor (const QColor &color)
QPixmap canvasPixmap () const
QPixmap erasePixmap () const
void setErasePixmap (const QPixmap &pm)

Métodos protegidos

void resizeEvent (QResizeEvent *e)
void paintEvent (QPaintEvent *e)

Propiedades

QString penColor
QString brushColor
QString backgroundColor
QString fontFamily
int pointSize
int penWidth
QPixmap pixmap
QPixmap erasePixmap

Documentación del constructor y destructor

PaintWidget::PaintWidget ( QWidget parent = 0,
const char *  name = 0 
)
PaintWidget::~PaintWidget ( )

Documentación de las funciones miembro

QString PaintWidget::backgroundColorEx ( ) const
QString PaintWidget::brushColor ( ) const
QPixmap PaintWidget::canvasPixmap ( ) const [inline]
void PaintWidget::drawArc ( int  x,
int  y,
int  w,
int  h,
int  a,
int  alen 
) [slot]
void PaintWidget::drawChord ( int  x,
int  y,
int  w,
int  h,
int  a,
int  alen 
) [slot]
void PaintWidget::drawEllipse ( int  x,
int  y,
int  w,
int  h 
) [slot]
void PaintWidget::drawLine ( int  x1,
int  y1,
int  x2,
int  y2 
) [slot]
void PaintWidget::drawPie ( int  x,
int  y,
int  w,
int  h,
int  a,
int  alen 
) [slot]
void PaintWidget::drawPixmap ( int  x,
int  y,
const QPixmap pixmap 
) [slot]
void PaintWidget::drawPoint ( int  x,
int  y 
) [slot]
void PaintWidget::drawRect ( int  x,
int  y,
int  w,
int  h 
) [slot]
void PaintWidget::drawRoundRect ( int  x,
int  y,
int  w,
int  h,
int  xRnd,
int  yRnd 
) [slot]
int PaintWidget::drawText ( int  x,
int  y,
int  w,
int  h,
const QString text,
bool  wordWrap 
) [slot]
void PaintWidget::drawText ( int  x,
int  y,
const QString str 
) [slot]

Writes str at position x,y.

The y position is the base line position of the text. The text is drawn using the default font and the default foreground color.

This function is provided for convenience. You will generally get more flexible results and often higher speed by using a a painter instead.

Ver también:
setFont(), foregroundColor(), QPainter::drawText()

Draws the string str at position (x, y).

The y position is the base line position of the text. The text is drawn using the default font and the default foreground color.

This function is provided for convenience. You will generally get more flexible results and often higher speed by using a a painter instead.

Ver también:
setFont(), foregroundColor(), QPainter::drawText()

Reimplementado de QWidget.

void PaintWidget::erase ( ) [slot]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This version erases the entire widget.

Reimplementado de QWidget.

QPixmap PaintWidget::erasePixmap ( ) const [inline]

Returns the widget's erase pixmap.

Ver también:
setErasePixmap() eraseColor()

Reimplementado de QWidget.

void PaintWidget::eraseRect ( int  x,
int  y,
int  w,
int  h 
) [slot]
void PaintWidget::fillRect ( int  x,
int  y,
int  w,
int  h 
) [slot]
void PaintWidget::flush ( ) [slot]
QString PaintWidget::fontFamily ( ) const
void PaintWidget::lineTo ( int  x,
int  y 
) [slot]
void PaintWidget::moveTo ( int  x,
int  y 
) [slot]
void PaintWidget::paintEvent ( QPaintEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive paint events.

A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons.

Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QCanvas do this, for example.

Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, Qt merges these events into one event with a larger region (see QRegion::unite()). repaint() does not permit this optimization, so we suggest using update() when possible.

When the paint event occurs, the update region has normally been erased, so that you're painting on the widget's background. There are a couple of exceptions and QPaintEvent::erased() tells you whether the widget has been erased or not.

The background can be set using setBackgroundMode(), setPaletteBackgroundColor() or setBackgroundPixmap(). The documentation for setBackgroundMode() elaborates on the background; we recommend reading it.

Ver también:
event(), repaint(), update(), QPainter, QPixmap, QPaintEvent

Reimplementado de QWidget.

QString PaintWidget::penColor ( ) const
int PaintWidget::penWidth ( ) const
int PaintWidget::pointSize ( ) const
void PaintWidget::resizeEvent ( QResizeEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget resize events. When resizeEvent() is called, the widget already has its new geometry. The old size is accessible through QResizeEvent::oldSize().

The widget will be erased and receive a paint event immediately after processing the resize event. No drawing need be (or should be) done inside this handler.

Widgets that have been created with the WNoAutoErase flag will not be erased. Nevertheless, they will receive a paint event for their entire area afterwards. Again, no drawing needs to be done inside this handler.

The default implementation calls updateMask() if the widget has automatic masking enabled.

Ver también:
moveEvent(), event(), resize(), QResizeEvent, paintEvent()

Reimplementado de QWidget.

void PaintWidget::setBackgroundColor ( const QString color)
void PaintWidget::setBrushColor ( const QString color)
void PaintWidget::setClipRect ( int  x,
int  y,
int  w,
int  h 
) [slot]
void PaintWidget::setErasePixmap ( const QPixmap pixmap) [inline, virtual]

Sets the widget's erase pixmap to pixmap.

This pixmap is used to clear the widget before paintEvent() is called.

Reimplementado de QWidget.

void PaintWidget::setFontFamily ( const QString family)
void PaintWidget::setPaletteBackgroundColor ( const QColor color) [virtual]

Reimplementado de QWidget.

void PaintWidget::setPenColor ( const QString color)
void PaintWidget::setPenWidth ( int  width)
void PaintWidget::setPointSize ( int  size)
void PaintWidget::setWindow ( int  x,
int  y,
int  w,
int  h 
) [slot]
int PaintWidget::textAscent ( ) [slot]
int PaintWidget::textDescent ( ) [slot]
int PaintWidget::textHeight ( ) [slot]
int PaintWidget::textWidth ( const QString text) [slot]
void PaintWidget::updateContents ( ) [signal]

Documentación de propiedades

QString PaintWidget::backgroundColor [read, write]
QString PaintWidget::brushColor [read, write]
QPixmap PaintWidget::erasePixmap [read, write]
QString PaintWidget::fontFamily [read, write]
QString PaintWidget::penColor [read, write]
int PaintWidget::penWidth [read, write]
QPixmap PaintWidget::pixmap [read]
int PaintWidget::pointSize [read, write]

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'