QwtText(3) | Qwt User's Guide | QwtText(3) |
QwtText -
#include <qwt_text.h>
enum LayoutAttribute { MinimumLayout = 1 }
enum PaintAttribute { PaintUsingTextFont = 1,
PaintUsingTextColor = 2, PaintBackground = 4 }
enum TextFormat { AutoText = 0, PlainText,
RichText, MathMLText, TeXText, OtherFormat = 100
}
QwtText (const QString &=QString::null,
TextFormat textFormat=AutoText)
QwtText (const QwtText &)
~QwtText ()
QBrush backgroundBrush () const
QPen backgroundPen () const
QColor color () const
void draw (QPainter *painter, const QRect &rect) const
QFont font () const
int heightForWidth (int width, const QFont &=QFont()) const
bool isEmpty () const
bool isNull () const
int operator!= (const QwtText &) const
QwtText & operator= (const QwtText &)
int operator== (const QwtText &) const
int renderFlags () const
void setBackgroundBrush (const QBrush &)
void setBackgroundPen (const QPen &)
void setColor (const QColor &)
void setFont (const QFont &)
void setLayoutAttribute (LayoutAttribute, bool on=true)
void setPaintAttribute (PaintAttribute, bool on=true)
void setRenderFlags (int flags)
void setText (const QString &, QwtText::TextFormat
textFormat=AutoText)
bool testLayoutAttribute (LayoutAttribute) const
bool testPaintAttribute (PaintAttribute) const
QString text () const
QSize textSize (const QFont &=QFont()) const
QColor usedColor (const QColor &) const
QFont usedFont (const QFont &) const
static void setTextEngine (QwtText::TextFormat,
QwtTextEngine *)
static const QwtTextEngine * textEngine (const QString
&text, QwtText::TextFormat=AutoText)
static const QwtTextEngine * textEngine
(QwtText::TextFormat)
A class representing a text.
A QwtText is a text including a set of attributes how to render it.
See also:
Layout Attributes. The layout attributes affects some aspects of the layout of the text.
Paint Attributes. Font and color and background are optional attributes of a QwtText. The paint attributes hold the information, if they are set.
Text format. The text format defines the QwtTextEngine, that is used to render the text.
See also:
Constructor
Parameters:
Returns:
See also:
Returns:
See also:
Draw a text into a rectangle
Parameters:
Find the height for a given width
Parameters:
Returns:
Returns:
Returns:
Returns:
See also:
Set the background brush
Parameters:
See also:
Set the background pen
Parameters:
See also:
Set the pen color used for painting the text.
Parameters:
Note:
Set the font.
Parameters:
Note:
Change a layout attribute
Parameters:
See also:
Change a paint attribute
Parameters:
Note:
See also:
Change the render flags. The default setting is Qt::AlignCenter
Parameters:
See also:
Note:
Assign a new text content
Parameters:
See also:
Assign/Replace a text engine for a text format
With setTextEngine it is possible to extend Qwt with other types of text formats.
Owner of a commercial Qt license can build the qwtmathml library, that is based on the MathML renderer, that is included in MML Widget component of the Qt solutions package.
For QwtText::PlainText it is not allowed to assign a engine == NULL.
Parameters:
See also:
Warning:
Test a layout attribute
Parameters:
Returns:
See also:
Test a paint attribute
Parameters:
Returns:
See also:
Return the text.
See also:
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.
Parameters:
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.
Parameters:
Returns:
Find the height for a given width
Parameters:
Returns:
Returns the size, that is needed to render text
Parameters:
Returns:
Return the color of the text, if it has one. Otherwise return defaultColor.
Parameters:
See also:
Return the font of the text, if it has one. Otherwise return defaultFont.
Parameters:
See also:
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Tue Nov 20 2012 | Version 5.2.3 |