163 lines
4.1 KiB
Groff
163 lines
4.1 KiB
Groff
.TH "QwtTextEngine" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*-
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
QwtTextEngine \- Abstract base class for rendering text strings\&.
|
|
|
|
.SH SYNOPSIS
|
|
.br
|
|
.PP
|
|
.PP
|
|
\fC#include <qwt_text_engine\&.h>\fP
|
|
.PP
|
|
Inherited by \fBQwtPlainTextEngine\fP, and \fBQwtRichTextEngine\fP\&.
|
|
.SS "Public Member Functions"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "virtual \fB~QwtTextEngine\fP ()"
|
|
.br
|
|
.RI "Destructor\&. "
|
|
.ti -1c
|
|
.RI "virtual double \fBheightForWidth\fP (const QFont &font, int flags, const QString &text, double width) const =0"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual QSizeF \fBtextSize\fP (const QFont &font, int flags, const QString &text) const =0"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual bool \fBmightRender\fP (const QString &text) const =0"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual void \fBtextMargins\fP (const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const =0"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual void \fBdraw\fP (QPainter *painter, const QRectF &rect, int flags, const QString &text) const =0"
|
|
.br
|
|
.in -1c
|
|
.SS "Protected Member Functions"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "\fBQwtTextEngine\fP ()"
|
|
.br
|
|
.RI "Constructor\&. "
|
|
.in -1c
|
|
.SH "Detailed Description"
|
|
.PP
|
|
Abstract base class for rendering text strings\&.
|
|
|
|
A text engine is responsible for rendering texts for a specific text format\&. They are used by \fBQwtText\fP to render a text\&.
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBQwtText::setTextEngine()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 30 of file qwt_text_engine\&.h\&.
|
|
.SH "Member Function Documentation"
|
|
.PP
|
|
.SS "virtual void QwtTextEngine::draw (QPainter * painter, const QRectF & rect, int flags, const QString & text) const\fC [pure virtual]\fP"
|
|
Draw the text in a clipping rectangle
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIpainter\fP Painter
|
|
.br
|
|
\fIrect\fP Clipping rectangle
|
|
.br
|
|
\fIflags\fP Bitwise OR of the flags like in for QPainter::drawText()
|
|
.br
|
|
\fItext\fP Text to be rendered
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Implemented in \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
|
|
.SS "virtual double QwtTextEngine::heightForWidth (const QFont & font, int flags, const QString & text, double width) const\fC [pure virtual]\fP"
|
|
Find the height for a given width
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIfont\fP Font of the text
|
|
.br
|
|
\fIflags\fP Bitwise OR of the flags used like in QPainter::drawText
|
|
.br
|
|
\fItext\fP Text to be rendered
|
|
.br
|
|
\fIwidth\fP Width
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Calculated height
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Implemented in \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
|
|
.SS "virtual bool QwtTextEngine::mightRender (const QString & text) const\fC [pure virtual]\fP"
|
|
Test if a string can be rendered by this text engine
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fItext\fP Text to be tested
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
true, if it can be rendered
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Implemented in \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
|
|
.SS "virtual void QwtTextEngine::textMargins (const QFont & font, const QString & text, double & left, double & right, double & top, double & bottom) const\fC [pure virtual]\fP"
|
|
Return margins around the texts
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIfont\fP Font of the text
|
|
.br
|
|
\fItext\fP Text to be rendered
|
|
.br
|
|
\fIleft\fP Return value for the left margin
|
|
.br
|
|
\fIright\fP Return value for the right margin
|
|
.br
|
|
\fItop\fP Return value for the top margin
|
|
.br
|
|
\fIbottom\fP Return value for the bottom margin
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Implemented in \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
|
|
.SS "virtual QSizeF QwtTextEngine::textSize (const QFont & font, int flags, const QString & text) const\fC [pure virtual]\fP"
|
|
Returns the size, that is needed to render text
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIfont\fP Font of the text
|
|
.br
|
|
\fIflags\fP Bitwise OR of the flags like in for QPainter::drawText
|
|
.br
|
|
\fItext\fP Text to be rendered
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Calculated size
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Implemented in \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
|
|
|
|
.SH "Author"
|
|
.PP
|
|
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|