A Widget which displays a QwtText
更多...
#include <qwt_text_label.h>
|
| | QwtTextLabel (QWidget *parent=nullptr) |
| | Constructs an empty label
|
| |
| | QwtTextLabel (const QwtText &, QWidget *parent=nullptr) |
| | Constructs a label that displays the text
|
| |
|
| ~QwtTextLabel () override |
| | Destructor
|
| |
| void | setPlainText (const QString &) |
| | Interface for the designer plugin - does the same as setText()
|
| |
| QString | plainText () const |
| | Interface for the designer plugin
|
| |
| const QwtText & | text () const |
| | Return the text
|
| |
| int | indent () const |
| | Return label's text indent in pixels
|
| |
| void | setIndent (int) |
| | Set label's text indent in pixels
|
| |
| int | margin () const |
| | Return label's margin in pixels
|
| |
| void | setMargin (int) |
| | Set label's margin in pixels
|
| |
| virtual QSize | sizeHint () const override |
| | Return a size hint
|
| |
| virtual QSize | minimumSizeHint () const override |
| | Return a minimum size hint
|
| |
| virtual int | heightForWidth (int) const override |
| | Return the preferred height for a given width
|
| |
| QRect | textRect () const |
| | Calculate geometry for the text in widget coordinates
|
| |
| virtual void | drawText (QPainter *, const QRectF &) |
| | Redraw the text
|
| |
|
| virtual void | paintEvent (QPaintEvent *) override |
| | Paint event handler
|
| |
| virtual void | drawContents (QPainter *) |
| | Draw the contents
|
| |
|
|
int | indent |
| |
|
int | margin |
| |
|
QString | plainText |
| |
A Widget which displays a QwtText
QwtTextLabel displays a text label supporting rich text formatting and rotated text. The text can be aligned horizontally and vertically.
- 参见
- QwtText
◆ QwtTextLabel() [1/2]
| QwtTextLabel::QwtTextLabel |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Constructs an empty label
- 参数
-
◆ QwtTextLabel() [2/2]
| QwtTextLabel::QwtTextLabel |
( |
const QwtText & |
text, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Constructs a label that displays the text
- 参数
-
| parent | Parent widget |
| text | Text to display |
◆ clear
| void QwtTextLabel::clear |
( |
| ) |
|
|
slot |
◆ drawContents()
| void QwtTextLabel::drawContents |
( |
QPainter * |
painter | ) |
|
|
protectedvirtual |
Draw the contents
Redraw the text and focus indicator
◆ drawText()
| void QwtTextLabel::drawText |
( |
QPainter * |
painter, |
|
|
const QRectF & |
textRect |
|
) |
| |
|
virtual |
Redraw the text
- 参数
-
| painter | Painter used for drawing |
| textRect | Rectangle where to draw the text |
- 参见
- drawContents()
◆ heightForWidth()
| int QwtTextLabel::heightForWidth |
( |
int |
width | ) |
const |
|
overridevirtual |
◆ indent()
| int QwtTextLabel::indent |
( |
| ) |
const |
Return label's text indent in pixels
- 返回
- Indent in pixels
- 参见
- setIndent()
◆ margin()
| int QwtTextLabel::margin |
( |
| ) |
const |
Return label's margin in pixels
- 返回
- Margin in pixels
- 参见
- setMargin()
◆ minimumSizeHint()
| QSize QwtTextLabel::minimumSizeHint |
( |
| ) |
const |
|
overridevirtual |
Return a minimum size hint
- 返回
- Minimum size hint
- 参见
- sizeHint()
◆ paintEvent()
| void QwtTextLabel::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotectedvirtual |
◆ plainText()
| QString QwtTextLabel::plainText |
( |
| ) |
const |
◆ setIndent()
| void QwtTextLabel::setIndent |
( |
int |
indent | ) |
|
Set label's text indent in pixels
- 参数
-
| indent | Indentation in pixels |
- 参见
- indent()
◆ setMargin()
| void QwtTextLabel::setMargin |
( |
int |
margin | ) |
|
Set label's margin in pixels
- 参数
-
- 参见
- margin()
◆ setPlainText()
| void QwtTextLabel::setPlainText |
( |
const QString & |
text | ) |
|
Interface for the designer plugin - does the same as setText()
- 参数
-
- 参见
- plainText()
◆ setText [1/2]
Change the label's text, keeping all other QwtText attributes
- 参数
-
| text | New text |
| textFormat | Format of text |
- 参见
- QwtText
◆ setText [2/2]
| void QwtTextLabel::setText |
( |
const QwtText & |
text | ) |
|
|
virtualslot |
◆ sizeHint()
| QSize QwtTextLabel::sizeHint |
( |
| ) |
const |
|
overridevirtual |
◆ text()
| const QwtText & QwtTextLabel::text |
( |
| ) |
const |
Return the text
- 返回
- Current text
- 参见
- setText(), plainText()
◆ textRect()
| QRect QwtTextLabel::textRect |
( |
| ) |
const |
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/plot/qwt_text_label.h
- /home/runner/work/QWT/QWT/src/plot/qwt_text_label.cpp