Inherited by QwtPlainText, and QwtRichText.
A virtual class to draw text.
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.
Warning:
Definition at line 35 of file qwt_text.h.
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 setAlignment (int align)
int alignment () 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
QwtText * makeText (const QString &, Qt::TextFormat, int align, const QFont &, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))
QwtText * makeText (const QString &, int align, const QFont &, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))
void setDefaultFormat (Qt::TextFormat)
Qt::TextFormat defaultFormat ()
QwtText (const QString &text, const QFont &, int align, const QColor &, const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))
Destructor.
Definition at line 44 of file qwt_text.cpp.
Constructor.
Parameters:
Definition at line 31 of file qwt_text.cpp.
Get the alignment flags.
Definition at line 151 of file qwt_text.cpp.
Referenced by QwtRichText::boundingRect(), QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtScale::drawTitle(), QwtPlainText::heightForWidth(), QwtMarker::setLabel(), QwtRichText::setText(), QwtScale::setTitle(), and QwtScale::titleAlignment().
Returns the bounding rectangle.
The bounding rectangle is calculated with respect to (0, 0). The left and top border depend on the alignment flags:
Use for instance QRect::moveBy(x,y), before drawing the text into the rectangle.
Implemented in QwtPlainText, and QwtRichText.
Referenced by QwtMarker::draw(), QwtPicker::drawCursorLabel(), and QwtPushButton::heightForWidth().
Create a clone
Implemented in QwtPlainText, and QwtRichText.
Referenced by QwtMarker::operator=(), and QwtMarker::QwtMarker().
Return the color.
Definition at line 163 of file qwt_text.cpp.
Referenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::labelColor(), QwtMarker::labelPen(), QwtMarker::setLabel(), QwtMarker::setLabelColor(), QwtMarker::setLabelPen(), QwtMarker::setLabelText(), QwtScale::setTitle(), and QwtScale::titleColor().
Return default format for the QwtText factory.
Definition at line 105 of file qwt_text.cpp.
Draw the text in a clipping rectangle.
Parameters:
Implemented in QwtPlainText, and QwtRichText.
Referenced by QwtMarker::draw(), QwtPicker::drawCursorLabel(), QwtLegendItem::drawItem(), QwtScale::drawTitle(), and QwtPlot::printTitle().
Return the font.
Definition at line 130 of file qwt_text.cpp.
Referenced by QwtRichText::boundingRect(), QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::font(), QwtRichText::heightForWidth(), QwtRichText::setAlignment(), QwtMarker::setFont(), QwtMarker::setLabel(), QwtMarker::setLabelText(), QwtRichText::setText(), QwtScale::setTitle(), QwtScale::setTitleFont(), and QwtScale::titleFont().
Return the font metrics.
Definition at line 136 of file qwt_text.cpp.
Referenced by QwtPlainText::boundingRect(), and QwtPlainText::heightForWidth().
Find the height for a given width.
Parameters:
Returns:
Implemented in QwtPlainText, and QwtRichText.
Referenced by QwtPushButton::heightForWidth(), and QwtScale::titleHeightForWidth().
Factory function for QwtText objects. Creates a text according to QwtText::defaultFormat()
Parameters:
Returns:
See also:
Definition at line 61 of file qwt_text.cpp.
Factory function for QwtText objects.
Parameters:
Returns:
Definition at line 81 of file qwt_text.cpp.
Referenced by QwtPicker::drawCursorLabel(), QwtPushButton::heightForWidth(), makeText(), QwtPlot::printTitle(), QwtMarker::QwtMarker(), QwtMarker::setLabel(), QwtScale::setTitle(), QwtLegendLabel::titleText(), and QwtLegendButton::titleText().
Return the rectangle brush.
Definition at line 187 of file qwt_text.cpp.
Referenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::setLabel(), and QwtMarker::setLabelText().
Return the rectangle pen.
Definition at line 175 of file qwt_text.cpp.
Referenced by QwtRichText::clone(), QwtPlainText::clone(), QwtRichText::draw(), QwtPlainText::draw(), QwtMarker::setLabel(), and QwtMarker::setLabelText().
Set the alignment flags.
Parameters:
Reimplemented in QwtRichText.
Definition at line 145 of file qwt_text.cpp.
Referenced by QwtScale::drawTitle(), QwtRichText::setAlignment(), and QwtScale::setTitleAlignment().
Set the color.
Definition at line 157 of file qwt_text.cpp.
Referenced by QwtMarker::setLabelColor(), QwtMarker::setLabelPen(), and QwtScale::setTitleColor().
Set the default format for the QwtText factory.
Definition at line 99 of file qwt_text.cpp.
Set the font.
Reimplemented in QwtRichText.
Definition at line 123 of file qwt_text.cpp.
Referenced by QwtRichText::setFont(), QwtMarker::setFont(), and QwtScale::setTitleFont().
Set the rectangle brush.
Definition at line 181 of file qwt_text.cpp.
Set the rectangle pen.
Definition at line 169 of file qwt_text.cpp.
Set the text.
Reimplemented in QwtRichText.
Definition at line 111 of file qwt_text.cpp.
Referenced by QwtRichText::setText().
Return the text.
Definition at line 117 of file qwt_text.cpp.
Referenced by QwtPlainText::boundingRect(), QwtRichText::clone(), QwtPlainText::clone(), QwtScale::dimForLength(), QwtPlainText::draw(), QwtMarker::draw(), QwtPlainText::heightForWidth(), QwtMarker::label(), QwtRichText::setAlignment(), QwtMarker::setLabel(), and QwtScale::title().
Generated automatically by Doxygen for Qwt User's Guide from the source code.