QwtTextEngine(3)
π QwtTextEngine β Library Functions Manual energy, bestie
okay so picture this: you're out here tryna render text strings in a specific format, and this abstract base class is the blueprint. It's QwtTextEngine, and honestly? She's the main character of text rendering. β¨
π¦ NAME
QwtTextEngine β the abstract base class for rendering text strings, no cap.
π SYNOPSIS
#include <qwt_text_engine.h>
Inherited by: QwtPlainTextEngine, and QwtRichTextEngine β they're the ones actually doing the visible work, we're just the vibe here. π
πΈ Public Member Functions
virtual ~QwtTextEngine ()β destructor, she's got to go eventually πvirtual double heightForWidth (const QFont &font, int flags, const QString &text, double width) const =0β pure virtual, you must implement thisvirtual QSizeF textSize (const QFont &font, int flags, const QString &text) const =0virtual bool mightRender (const QString &text) const =0virtual void textMargins (const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const =0virtual void draw (QPainter *painter, const QRectF &rect, int flags, const QString &text) const =0
π§ Protected Member Functions
QwtTextEngine ()β constructor, protected because she's exclusive π
β¨ Detailed Description
Abstract base class for rendering text strings. Periodt.
A text engine is responsible for rendering texts for a specific text format β so like, imagine each engine is a different aesthetic. They are used by QwtText to render a text.
See also: QwtText::setTextEngine()
Definition at line 30 of file qwt_text_engine.h. π
π«Ά Constructor & Destructor Documentation
QwtTextEngine::~QwtTextEngine () [virtual]
Destructor. Saying bye bestie π
Definition at line 146 of file qwt_text_engine.cpp.
QwtTextEngine::QwtTextEngine () [protected]
Constructor. Protected, so only the chosen ones can build her β iykyk.
Definition at line 141 of file qwt_text_engine.cpp.
π Member Function Documentation
virtual void QwtTextEngine::draw (QPainter *painter, const QRectF &rect, int flags, const QString &text) const [pure virtual]
Draw the text in a clipping rectangle. It's giving aesthetic boundaries.
Parameters:
- painter β Painter
- rect β Clipping rectangle
- flags β Bitwise OR of the flags like in for
QPainter::drawText() - text β Text to be rendered
Implemented in: QwtPlainTextEngine, and QwtRichTextEngine.
virtual double QwtTextEngine::heightForWidth (const QFont &font, int flags, const QString &text, double width) const [pure virtual]
Find the height for a given width β like math but make it fashion. π
Parameters:
- font β Font of the text
- flags β Bitwise OR of the flags used like in
QPainter::drawText - text β Text to be rendered
- width β Width
Returns: Calculated height
Implemented in: QwtPlainTextEngine, and QwtRichTextEngine.
virtual bool QwtTextEngine::mightRender (const QString &text) const [pure virtual]
Test if a string can be rendered by this text engine β a little vibe check on your string. π
Parameters:
- text β Text to be tested
Returns: true, if it can be rendered
Implemented in: QwtPlainTextEngine, and QwtRichTextEngine.
virtual void QwtTextEngine::textMargins (const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const [pure virtual]
Return margins around the texts. π
The textSize might include margins around the text, like QFontMetrics::descent(). In situations where texts need to be aligned in detail, knowing these margins might improve the layout calculations. So like, if you're a perfectionist about alignment β this is your moment.
Parameters:
- font β Font of the text
- text β Text to be rendered
- left β Return value for the left margin
- right β Return value for the right margin
- top β Return value for the top margin
- bottom β Return value for the bottom margin
Implemented in: QwtPlainTextEngine, and QwtRichTextEngine.
virtual QSizeF QwtTextEngine::textSize (const QFont &font, int flags, const QString &text) const [pure virtual]
Returns the size, that is needed to render text β the literal measurements of the situation. π
Parameters:
- font β Font of the text
- flags β Bitwise OR of the flags like in for
QPainter::drawText - text β Text to be rendered
Returns: Calculated size
Implemented in: QwtPlainTextEngine, and QwtRichTextEngine.
π Author
Generated automatically by Doxygen for Qwt User's Guide from the source code. Not me writing it by hand, the robot did it π
and that's the whole page bestie!! slay π this whole thing came straight from Qwt User's Guide and was living under the QwtTextEngine(3) label in the Library Functions Manual β be sure to stan the source before you go π«Άβ¨π
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms