logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

QwtTextEngine - Abstract base class for rendering text strings.

Author

       Generated automatically by Doxygen for Qwt User's Guide from the source code.

Version 6.1.4                                    Wed Jan 2 2019                                 QwtTextEngine(3)

Detailed Description

       Abstract base class for rendering text strings.

       A text engine is responsible for rendering texts for a specific text format. They are used by QwtText to
       render a text.

       QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library. The implementation of
       QwtMathMLTextEngine uses code from the Qt solution package. Because of license implications it is built
       into a separate library.

       Seealso:QwtText::setTextEngine()

Member Function Documentation

virtualvoidQwtTextEngine::draw(QPainter*painter,constQRectF&rect,intflags,constQString&text)const[purevirtual]
       Draw the text in a clipping rectangle

       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.

   virtualdoubleQwtTextEngine::heightForWidth(constQFont&font,intflags,constQString&text,doublewidth)const[purevirtual]
       Find the height for a given width

       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.

   virtualboolQwtTextEngine::mightRender(constQString&text)const[purevirtual]
       Test if a string can be rendered by this text engine

       Parameters:text Text to be tested

       Returns:
           true, if it can be rendered

       Implemented in QwtRichTextEngine, QwtPlainTextEngine, and QwtMathMLTextEngine.

   virtualvoidQwtTextEngine::textMargins(constQFont&font,constQString&text,double&left,double&right,double&top,double&bottom)const[purevirtual]
       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.

       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.

   virtualQSizeFQwtTextEngine::textSize(constQFont&font,intflags,constQString&text)const[purevirtual]
       Returns the size, that is needed to render text

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

Name

       QwtTextEngine - Abstract base class for rendering text strings.

Synopsis

       #include <qwt_text_engine.h>

       Inherited by QwtMathMLTextEngine, QwtPlainTextEngine, and QwtRichTextEngine.

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

   ProtectedMemberFunctionsQwtTextEngine ()
           Constructor.

See Also