Eneboo - Documentación para desarrolladores
|
#include <quickpaintwidget.h>
PaintWidget::PaintWidget | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
PaintWidget::~PaintWidget | ( | ) |
QString PaintWidget::backgroundColorEx | ( | ) | const |
QString PaintWidget::brushColor | ( | ) | const |
QPixmap PaintWidget::canvasPixmap | ( | ) | const [inline] |
int PaintWidget::drawText | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
const QString & | text, | ||
bool | wordWrap | ||
) | [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.
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.
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.
Reimplementado de QWidget.
void PaintWidget::flush | ( | ) | [slot] |
QString PaintWidget::fontFamily | ( | ) | const |
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.
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.
Reimplementado de QWidget.
void PaintWidget::setBackgroundColor | ( | const QString & | color | ) |
void PaintWidget::setBrushColor | ( | const QString & | color | ) |
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 | ) |
int PaintWidget::textAscent | ( | ) | [slot] |
int PaintWidget::textDescent | ( | ) | [slot] |
int PaintWidget::textHeight | ( | ) | [slot] |
void PaintWidget::updateContents | ( | ) | [signal] |
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] |