QwtText(3) | Qwt User's Guide | QwtText(3) |
QwtText - A class representing a text.
#include <qwt_text.h>
enum TextFormat { AutoText = 0, PlainText,
RichText, MathMLText, TeXText, OtherFormat = 100
}
Text format. enum PaintAttribute { PaintUsingTextFont = 0x01,
PaintUsingTextColor = 0x02, PaintBackground = 0x04 }
Paint Attributes. enum LayoutAttribute { MinimumLayout = 0x01 }
Layout Attributes The layout attributes affects some aspects of the layout of
the text. typedef QFlags< PaintAttribute >
PaintAttributes
Paint attributes. typedef QFlags< LayoutAttribute >
LayoutAttributes
Layout attributes.
QwtText (const QString &=QString(), TextFormat
textFormat=AutoText)
QwtText (const QwtText &)
Copy constructor. ~QwtText ()
Destructor. QwtText & operator= (const QwtText &)
Assignment operator. bool operator== (const QwtText &) const
Relational operator. bool operator!= (const QwtText &) const
Relational operator. void setText (const QString &,
QwtText::TextFormat textFormat=AutoText)
QString text () const
bool isNull () const
bool isEmpty () const
void setFont (const QFont &)
QFont font () const
Return the font. QFont usedFont (const QFont &) const
void setRenderFlags (int)
Change the render flags. int renderFlags () const
void setColor (const QColor &)
QColor color () const
Return the pen color, used for painting the text. QColor usedColor
(const QColor &) const
void setBorderRadius (double)
double borderRadius () const
void setBorderPen (const QPen &)
QPen borderPen () 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
double heightForWidth (double width, const QFont &=QFont()) const
QSizeF textSize (const QFont &=QFont()) const
void draw (QPainter *painter, const QRectF &rect) const
static const QwtTextEngine * textEngine (const
QString &text, QwtText::TextFormat=AutoText)
static const QwtTextEngine * textEngine
(QwtText::TextFormat)
Find the text engine for a text format. static void setTextEngine
(QwtText::TextFormat, QwtTextEngine *)
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.
Enumerator
Paint Attributes. Font and color and background are optional attributes of a QwtText. The paint attributes hold the information, if they are set.
Enumerator
Text format. The text format defines the QwtTextEngine, that is used to render the text.
See also:
Enumerator
QwtText::setTextEngine( QwtText::MathMLText, new QwtMathMLTextEngine() );
Constructor
Parameters:
Returns:
See also:
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 radius for the corners of the border frame
Parameters:
See also:
Set the pen color used for drawing 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.
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:
Returns:
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 returned.
If no text engine is registered for the format QwtPlainTextEngine is returnd.
Parameters:
Returns:
Find the text engine for a text format. textEngine can be used to find out if a text format is supported.
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:
Returns:
See also:
Return the font of the text, if it has one. Otherwise return defaultFont.
Parameters:
Returns:
See also:
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |