QwtText is an interface class for drawing plain and rich text. It provides also an interface for text classes that understand other text description languages such as LaTeX or LyX.
Definition at line 37 of file qwt_text.h.
Public Member Functions | |
virtual | ~QwtText () |
virtual void | setText (const QString &) |
QString | text () const |
bool | isNull () const |
bool | isEmpty () const |
virtual void | setFont (const QFont &) |
QFont | font () const |
QFontMetrics | fontMetrics () const |
virtual void | setFlags (int flags) |
int | flags () const |
virtual void | setColor (const QColor &) |
QColor | color () const |
virtual void | setRectPen (const QPen &) |
QPen | rectPen () const |
virtual void | setRectBrush (const QBrush &) |
QBrush | rectBrush () const |
virtual int | heightForWidth (int width) const =0 |
virtual QRect | boundingRect (QPainter *painter=0) const =0 |
virtual void | draw (QPainter *painter, const QRect &rect) const =0 |
virtual QwtText * | clone () const =0 |
Static Public Member Functions | |
static QwtText * | makeText (const QString &, Qt::TextFormat, int flags, const QFont &, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush)) |
static QwtText * | makeText (const QString &, int flags, const QFont &, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush)) |
static void | setDefaultFormat (Qt::TextFormat) |
static Qt::TextFormat | defaultFormat () |
Protected Member Functions | |
QwtText (const QString &text, const QFont &, int flags, const QColor &, const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush)) |
|
Destructor.
Definition at line 102 of file qwt_text.cpp. |
|
Constructor.
Definition at line 95 of file qwt_text.cpp. |
|
Returns the bounding rectangle. The bounding rectangle is calculated with respect to (0, 0). The left and top border depend on the flags:
Use for instance QRect::moveBy(x,y), before drawing the text into the rectangle. Implemented in QwtPlainText, and QwtRichText. Referenced by QwtRichText::boundingRect(), and QwtPlainText::boundingRect(). |
|
Create a clone Implemented in QwtPlainText, and QwtRichText. |
|
Return the color.
Definition at line 231 of file qwt_text.cpp. Referenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtPlotMarker::labelColor(), makeText(), QwtText(), and setColor(). |
|
Return default format for the QwtText factory.
Definition at line 173 of file qwt_text.cpp. Referenced by makeText(). |
|
Draw the text in a clipping rectangle.
Implemented in QwtPlainText, and QwtRichText. Referenced by QwtLegendItem::drawItem(), QwtPicker::drawTracker(), and QwtPlot::printTitle(). |
|
Get the flags.
Definition at line 219 of file qwt_text.cpp. Referenced by QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtPlainText::heightForWidth(), setFlags(), and QwtRichText::setText(). |
|
Return the font.
Definition at line 198 of file qwt_text.cpp. Referenced by QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), makeText(), QwtText(), QwtRichText::setFlags(), setFont(), and QwtRichText::setText(). |
|
Return the font metrics.
Definition at line 204 of file qwt_text.cpp. Referenced by QwtPlainText::boundingRect(), QwtPlainText::heightForWidth(), and setFont(). |
|
Find the height for a given width.
Implemented in QwtPlainText, and QwtRichText. Referenced by QwtRichText::heightForWidth(), and QwtPlainText::heightForWidth(). |
|
Factory function for QwtText objects. Creates a text according to QwtText::defaultFormat()
Definition at line 120 of file qwt_text.cpp. References color(), defaultFormat(), font(), makeText(), and text(). |
|
Factory function for QwtText objects.
Definition at line 140 of file qwt_text.cpp. References color(), font(), and text(). Referenced by QwtPicker::drawTracker(), makeText(), QwtPlot::printTitle(), QwtPlotMarker::setLabel(), QwtScaleWidget::setTitle(), and QwtLegendItem::titleText(). |
|
Return the rectangle brush.
Definition at line 255 of file qwt_text.cpp. Referenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), and setRectBrush(). |
|
Return the rectangle pen.
Definition at line 243 of file qwt_text.cpp. Referenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), and setRectPen(). |
|
Set the color.
Definition at line 225 of file qwt_text.cpp. References color(). Referenced by QwtPlotMarker::setLabelColor(), and QwtPlotMarker::setLabelPen(). |
|
Set the default format for the QwtText factory.
Definition at line 167 of file qwt_text.cpp. |
|
Set the flags.
Reimplemented in QwtRichText. Definition at line 213 of file qwt_text.cpp. References flags(). Referenced by QwtRichText::setFlags(). |
|
Set the font.
Reimplemented in QwtRichText. Definition at line 191 of file qwt_text.cpp. References font(), and fontMetrics(). Referenced by QwtPlainText::boundingRect(), QwtRichText::draw(), QwtPlainText::draw(), and QwtRichText::setFont(). |
|
Set the rectangle brush.
Definition at line 249 of file qwt_text.cpp. References rectBrush(). |
|
Set the rectangle pen.
Definition at line 237 of file qwt_text.cpp. References rectPen(). |
|
Set the text.
Reimplemented in QwtRichText. Definition at line 179 of file qwt_text.cpp. References text(). Referenced by QwtRichText::setText(). |
|
Return the text.
Definition at line 185 of file qwt_text.cpp. Referenced by QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtPlainText::draw(), QwtPlainText::heightForWidth(), QwtPlotMarker::label(), makeText(), QwtText(), QwtRichText::setFlags(), and setText(). |