A QwtText is a text including a set of attributes how to render it.
Definition at line 51 of file qwt_text.h.
Public Types | |
enum | TextFormat { AutoText = 0, PlainText, RichText, MathMLText, TeXText, OtherFormat = 100 } |
enum | PaintAttribute { PaintUsingTextFont = 1, PaintUsingTextColor = 2, PaintBackground = 4 } |
enum | LayoutAttribute { MinimumLayout = 1 } |
Public Member Functions | |
QwtText (const QString &=QString::null, TextFormat textFormat=AutoText) | |
QwtText (const QwtText &) | |
~QwtText () | |
QwtText & | operator= (const QwtText &) |
int | operator== (const QwtText &) const |
int | operator!= (const QwtText &) const |
void | setText (const QString &, QwtText::TextFormat textFormat=AutoText) |
QString | text () const |
bool | isNull () const |
bool | isEmpty () const |
void | setFont (const QFont &) |
QFont | font () const |
QFont | usedFont (const QFont &) const |
void | setRenderFlags (int flags) |
int | renderFlags () const |
void | setColor (const QColor &) |
QColor | color () const |
QColor | usedColor (const QColor &) const |
void | setBackgroundPen (const QPen &) |
QPen | backgroundPen () const |
void | setBackgroundBrush (const QBrush &) |
QBrush | backgroundBrush () const |
void | setPaintAttribute (PaintAttribute, bool on=true) |
bool | testPaintAttribute (PaintAttribute) const |
void | setLayoutAttribute (LayoutAttribute, bool on=true) |
bool | testLayoutAttribute (LayoutAttribute) const |
int | heightForWidth (int width, const QFont &=QFont()) const |
QSize | textSize (const QFont &=QFont()) const |
void | draw (QPainter *painter, const QRect &rect) const |
Static Public Member Functions | |
static const QwtTextEngine * | textEngine (const QString &text, QwtText::TextFormat=AutoText) |
static const QwtTextEngine * | textEngine (QwtText::TextFormat) |
|
Layout Attributes. The layout attributes affects some aspects of the layout of the text.
Definition at line 129 of file qwt_text.h. |
|
Paint Attributes. Font and color and background are optional attributes of a QwtText. The paint attributes hold the information, if they are set.
Definition at line 111 of file qwt_text.h. |
|
Text format. The text format defines the QwtTextEngine, that is used to render the text.
Definition at line 85 of file qwt_text.h. |
|
Constructor
Definition at line 191 of file qwt_text.cpp. References textEngine(). |
|
Copy constructor.
Definition at line 201 of file qwt_text.cpp. References d_data, and d_layoutCache. |
|
Destructor.
Definition at line 211 of file qwt_text.cpp. |
|
Definition at line 398 of file qwt_text.cpp. |
|
Definition at line 377 of file qwt_text.cpp. |
|
Return the pen color, used for painting the text.
Definition at line 341 of file qwt_text.cpp. |
|
Draw a text into a rectangle
Definition at line 576 of file qwt_text.cpp. References QwtPainter::drawRect(), font(), QwtPainter::metricsMap(), QwtMetricsMap::screenToLayoutX(), and QwtMetricsMap::screenToLayoutY(). Referenced by QwtLegendItem::drawItem(), QwtScaleDraw::drawLabel(), QwtRoundScaleDraw::drawLabel(), QwtScaleWidget::drawTitle(), QwtPicker::drawTracker(), and QwtPlot::printTitle(). |
|
Return the font.
Definition at line 307 of file qwt_text.cpp. Referenced by draw(), heightForWidth(), and textSize(). |
|
Find the height for a given width
Definition at line 469 of file qwt_text.cpp. References font(), QwtMetricsMap::layoutToScreenX(), QwtPainter::metricsMap(), QwtMetricsMap::screenToLayoutY(), and usedFont(). |
|
Definition at line 152 of file qwt_text.h. Referenced by QwtScaleDraw::drawLabel(), QwtRoundScaleDraw::drawLabel(), QwtRoundScaleDraw::extent(), QwtScaleDraw::labelRect(), and QwtPicker::trackerRect(). |
|
Definition at line 149 of file qwt_text.h. |
|
Assignement operator.
Definition at line 218 of file qwt_text.cpp. References d_data, and d_layoutCache. |
|
Definition at line 288 of file qwt_text.cpp. Referenced by QwtScaleWidget::setTitle(). |
|
Set the background brush
Definition at line 388 of file qwt_text.cpp. References setPaintAttribute(). |
|
Set the background pen
Definition at line 367 of file qwt_text.cpp. References setPaintAttribute(). |
|
Set the pen color used for painting the text.
Definition at line 334 of file qwt_text.cpp. References setPaintAttribute(). Referenced by QwtPlotPrintFilter::reset(). |
|
Set the font.
Definition at line 300 of file qwt_text.cpp. References setPaintAttribute(). |
|
Change a layout attribute
Definition at line 440 of file qwt_text.cpp. |
|
Change a paint attribute
Definition at line 412 of file qwt_text.cpp. Referenced by setBackgroundBrush(), setBackgroundPen(), setColor(), and setFont(). |
|
Change the render flags. The default setting is Qt::AlignCenter
Definition at line 275 of file qwt_text.cpp. Referenced by QwtScaleWidget::drawTitle(), QwtLegendItem::setText(), QwtScaleWidget::setTitle(), and QwtAbstractScaleDraw::tickLabel(). |
|
Assign a new text content
Definition at line 248 of file qwt_text.cpp. References textEngine(). |
|
Test a layout attribute
Definition at line 456 of file qwt_text.cpp. |
|
Test a paint attribute
Definition at line 428 of file qwt_text.cpp. |
|
Return the text.
Definition at line 260 of file qwt_text.cpp. Referenced by QwtPlot::grabProperties(). |
|
Find the text engine for a text format. textEngine can be used to find out if a text format is supported. F.e, if one wants to use MathML labels, the MathML renderer from the commercial Qt solutions package might be required, that is not available in Qt Open Source Edition environments.
Definition at line 672 of file qwt_text.cpp. |
|
Find the text engine for a text format In case of QwtText::AutoText the first text engine (beside QwtPlainTextEngine) is returned, where QwtTextEngine::mightRender returns true. If there is none QwtPlainTextEngine is returnd. If no text engine is registered for the format QwtPlainTextEngine is returnd.
Definition at line 652 of file qwt_text.cpp. |
|
Returns the size, that is needed to render text
Definition at line 521 of file qwt_text.cpp. References font(), and usedFont(). Referenced by QwtScaleDraw::drawLabel(), QwtRoundScaleDraw::drawLabel(), QwtRoundScaleDraw::extent(), QwtScaleDraw::labelRect(), and QwtPicker::trackerRect(). |
|
Return the color of the text, if it has one. Otherwise return defaultColor.
Definition at line 353 of file qwt_text.cpp. |
|
Return the font of the text, if it has one. Otherwise return defaultFont.
Definition at line 319 of file qwt_text.cpp. Referenced by heightForWidth(), and textSize(). |