QwtTextEngine.3 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .TH "QwtTextEngine" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtTextEngine \- Abstract base class for rendering text strings\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_text_engine\&.h>\fP
  11. .PP
  12. Inherited by \fBQwtMathMLTextEngine\fP, \fBQwtPlainTextEngine\fP, and \fBQwtRichTextEngine\fP\&.
  13. .SS "Public Member Functions"
  14. .in +1c
  15. .ti -1c
  16. .RI "virtual \fB~QwtTextEngine\fP ()"
  17. .br
  18. .RI "Destructor\&. "
  19. .ti -1c
  20. .RI "virtual double \fBheightForWidth\fP (const QFont &font, int flags, const QString &text, double width) const =0"
  21. .br
  22. .ti -1c
  23. .RI "virtual QSizeF \fBtextSize\fP (const QFont &font, int flags, const QString &text) const =0"
  24. .br
  25. .ti -1c
  26. .RI "virtual bool \fBmightRender\fP (const QString &text) const =0"
  27. .br
  28. .ti -1c
  29. .RI "virtual void \fBtextMargins\fP (const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const =0"
  30. .br
  31. .ti -1c
  32. .RI "virtual void \fBdraw\fP (QPainter *painter, const QRectF &rect, int flags, const QString &text) const =0"
  33. .br
  34. .in -1c
  35. .SS "Protected Member Functions"
  36. .in +1c
  37. .ti -1c
  38. .RI "\fBQwtTextEngine\fP ()"
  39. .br
  40. .RI "Constructor\&. "
  41. .in -1c
  42. .SH "Detailed Description"
  43. .PP
  44. Abstract base class for rendering text strings\&.
  45. A text engine is responsible for rendering texts for a specific text format\&. They are used by \fBQwtText\fP to render a text\&.
  46. .PP
  47. \fBQwtPlainTextEngine\fP and \fBQwtRichTextEngine\fP are part of the Qwt library\&. The implementation of \fBQwtMathMLTextEngine\fP uses code from the Qt solution package\&. Because of license implications it is built into a separate library\&.
  48. .PP
  49. \fBSee also\fP
  50. .RS 4
  51. \fBQwtText::setTextEngine()\fP
  52. .RE
  53. .PP
  54. .SH "Member Function Documentation"
  55. .PP
  56. .SS "virtual void QwtTextEngine::draw (QPainter * painter, const QRectF & rect, int flags, const QString & text) const\fC [pure virtual]\fP"
  57. Draw the text in a clipping rectangle
  58. .PP
  59. \fBParameters\fP
  60. .RS 4
  61. \fIpainter\fP Painter
  62. .br
  63. \fIrect\fP Clipping rectangle
  64. .br
  65. \fIflags\fP Bitwise OR of the flags like in for QPainter::drawText()
  66. .br
  67. \fItext\fP Text to be rendered
  68. .RE
  69. .PP
  70. .PP
  71. Implemented in \fBQwtMathMLTextEngine\fP, \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
  72. .SS "virtual double QwtTextEngine::heightForWidth (const QFont & font, int flags, const QString & text, double width) const\fC [pure virtual]\fP"
  73. Find the height for a given width
  74. .PP
  75. \fBParameters\fP
  76. .RS 4
  77. \fIfont\fP Font of the text
  78. .br
  79. \fIflags\fP Bitwise OR of the flags used like in QPainter::drawText
  80. .br
  81. \fItext\fP Text to be rendered
  82. .br
  83. \fIwidth\fP Width
  84. .RE
  85. .PP
  86. \fBReturns\fP
  87. .RS 4
  88. Calculated height
  89. .RE
  90. .PP
  91. .PP
  92. Implemented in \fBQwtMathMLTextEngine\fP, \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
  93. .SS "virtual bool QwtTextEngine::mightRender (const QString & text) const\fC [pure virtual]\fP"
  94. Test if a string can be rendered by this text engine
  95. .PP
  96. \fBParameters\fP
  97. .RS 4
  98. \fItext\fP Text to be tested
  99. .RE
  100. .PP
  101. \fBReturns\fP
  102. .RS 4
  103. true, if it can be rendered
  104. .RE
  105. .PP
  106. .PP
  107. Implemented in \fBQwtMathMLTextEngine\fP, \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
  108. .SS "virtual void QwtTextEngine::textMargins (const QFont & font, const QString & text, double & left, double & right, double & top, double & bottom) const\fC [pure virtual]\fP"
  109. Return margins around the texts
  110. .PP
  111. 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\&.
  112. .PP
  113. \fBParameters\fP
  114. .RS 4
  115. \fIfont\fP Font of the text
  116. .br
  117. \fItext\fP Text to be rendered
  118. .br
  119. \fIleft\fP Return value for the left margin
  120. .br
  121. \fIright\fP Return value for the right margin
  122. .br
  123. \fItop\fP Return value for the top margin
  124. .br
  125. \fIbottom\fP Return value for the bottom margin
  126. .RE
  127. .PP
  128. .PP
  129. Implemented in \fBQwtMathMLTextEngine\fP, \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
  130. .SS "virtual QSizeF QwtTextEngine::textSize (const QFont & font, int flags, const QString & text) const\fC [pure virtual]\fP"
  131. Returns the size, that is needed to render text
  132. .PP
  133. \fBParameters\fP
  134. .RS 4
  135. \fIfont\fP Font of the text
  136. .br
  137. \fIflags\fP Bitwise OR of the flags like in for QPainter::drawText
  138. .br
  139. \fItext\fP Text to be rendered
  140. .RE
  141. .PP
  142. \fBReturns\fP
  143. .RS 4
  144. Calculated size
  145. .RE
  146. .PP
  147. .PP
  148. Implemented in \fBQwtMathMLTextEngine\fP, \fBQwtRichTextEngine\fP, and \fBQwtPlainTextEngine\fP\&.
  149. .SH "Author"
  150. .PP
  151. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.