QwtTextEngine(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

✨ QwtTextEngine ✨

okay bestie, welcome to the manual page for QwtTextEngine(3) from the Qwt User's Guide πŸ’– this is the abstract base class situation and honestly? it's giving blueprint energy. let's get into it 🫢


🌸 NAME 🌸

QwtTextEngine β€” the abstract text-rendering base class, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qwt_text_engine.h>

Inherited by QwtMathMLTextEngine, QwtPlainTextEngine, and QwtRichTextEngine.

πŸ‘‘ Public Member Functions

virtual ~QwtTextEngine ()
virtual void draw (QPainter *painter, const QRect &rect, int flags,
    const QString &text) const =0
virtual int heightForWidth (const QFont &font, int flags, const QString
    &text, int width) const =0
virtual bool mightRender (const QString &text) const =0
virtual void textMargins (const QFont &font, const QString &text, int
    &left, int &right, int &top, int &bottom) const =0
virtual QSize textSize (const QFont &font, int flags, const QString
    &text) const =0

πŸŽ€ Protected Member Functions

QwtTextEngine ()

πŸ’œ Detailed Description πŸ’œ

Abstract base class for rendering text strings. yes bestie, abstract β€” you cannot just make one of these and vibe, you gotta subclass it 😭

A text engine is responsible for rendering texts for a specific text format. They are used by QwtText to render a text. so like, QwtText is the main character and the text engine is the stylist doing the actual look ✨

QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library. 🫢

QwtMathMLTextEngine can be found in Qwt MathML extension, that needs the MathML renderer of the Qt solutions package. Unfortunately it is only available with a commercial Qt license. πŸ’€ yeah... that one's paywalled, sorry babe.

See also:

  • QwtText::setTextEngine()

⭐ Member Function Documentation ⭐

🧚 virtual void QwtTextEngine::draw (QPainter *painter, const QRect &rect, int flags, const QString &text) const [pure virtual]

Draw the text in a clipping rectangle. literally just, paint it πŸ’…

Parameters:

  • painter β€” Painter
  • rect β€” Clipping rectangle
  • flags β€” Bitwise OR of the flags like in for QPainter::drawText
  • text β€” Text to be rendered

Implemented in QwtRichTextEngine, QwtPlainTextEngine, and QwtMathMLTextEngine.


🌈 virtual int QwtTextEngine::heightForWidth (const QFont &font, int flags, const QString &text, int width) const [pure virtual]

Find the height for a given width. it's the "how tall does this get if you squeeze it to this wide" question ✨

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 QwtRichTextEngine, QwtPlainTextEngine, and QwtMathMLTextEngine.


πŸ¦‹ virtual bool QwtTextEngine::mightRender (const QString &text) const [pure virtual]

Test if a string can be rendered by this text engine. like a lil vibe check on the string πŸ‘€

Parameters:

  • text β€” Text to be tested

Returns:

  • true, if it can be rendered

Implemented in QwtRichTextEngine, QwtPlainTextEngine, and QwtMathMLTextEngine.


πŸŽ€ virtual void QwtTextEngine::textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const [pure virtual]

Return margins around the texts. the little breathing room, the personal space, the aura 🌸

The textSize might include margins around the text, like QFontMetrics::descent. In situations where texts need to be aligend in detail, knowing these margins might improve the layout calculations. (yes, "aligend" β€” that's the original's typo, we keep it fr fr πŸ™ˆ)

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 QwtRichTextEngine, QwtPlainTextEngine, and QwtMathMLTextEngine.


πŸ’– virtual QSize QwtTextEngine::textSize (const QFont &font, int flags, const QString &text) const [pure virtual]

Returns the size, that is needed to render text. the full measurements bestie, we're taking notes πŸ“

Parameters:

  • font β€” Font of the text
  • flags β€” Bitwise OR of the flags like in for QPainter::drawText
  • text β€” Text to be rendered

Returns:

  • Caluclated size

Implemented in QwtRichTextEngine, QwtPlainTextEngine, and QwtMathMLTextEngine.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Qwt User's Guide from the source code. so nobody hand-wrote this, Doxygen did it and honestly? it ate πŸ’…


πŸ’œ and that's the whole page bestie, you understood it, you slayed it, periodt ✨

Version 5.2.3 β€” dated Tue Nov 20 2012 β€” and that's QwtTextEngine(3) signing off πŸŽ€ bye babe, go render some text πŸ¦‹

πŸ“¦ where this page comes from