QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 槽 | Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
QwtTextLabel类 参考

A Widget which displays a QwtText 更多...

#include <qwt_text_label.h>

类 QwtTextLabel 继承关系图:
QwtLegendLabel

class  PrivateData
 

Public 槽

void setText (const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)
 Change the label's text, keeping all other QwtText attributes
 
virtual void setText (const QwtText &)
 Change the label's text
 
void clear ()
 Clear the text and all QwtText attributes
 

Public 成员函数

 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 QwtTexttext () 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
 

Protected 成员函数

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

参数
parentParent widget

◆ QwtTextLabel() [2/2]

QwtTextLabel::QwtTextLabel ( const QwtText text,
QWidget *  parent = nullptr 
)
explicit

Constructs a label that displays the text

参数
parentParent widget
textText to display

成员函数说明

◆ clear

void QwtTextLabel::clear ( )
slot

Clear the text and all QwtText attributes

参见
setText()

◆ 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

参数
painterPainter used for drawing
textRectRectangle where to draw the text
参见
drawContents()

◆ heightForWidth()

int QwtTextLabel::heightForWidth ( int  width) const
overridevirtual

Return the preferred height for a given width

参数
widthGiven width
返回
Preferred height for this widget, given the width
参见
sizeHint(), minimumSizeHint()

◆ 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

Paint event handler

Qt paint event handler

参数
eventPaint event
参见
drawContents(), paintEvent()

QwtLegendLabel 重载.

◆ plainText()

QString QwtTextLabel::plainText ( ) const

Interface for the designer plugin

返回
Text as plain text
参见
setPlainText(), text()

◆ setIndent()

void QwtTextLabel::setIndent ( int  indent)

Set label's text indent in pixels

参数
indentIndentation in pixels
参见
indent()

◆ setMargin()

void QwtTextLabel::setMargin ( int  margin)

Set label's margin in pixels

参数
marginMargin in pixels
参见
margin()

◆ setPlainText()

void QwtTextLabel::setPlainText ( const QString &  text)

Interface for the designer plugin - does the same as setText()

参数
textPlain text to set
参见
plainText()

◆ setText [1/2]

void QwtTextLabel::setText ( const QString &  text,
QwtText::TextFormat  textFormat = QwtText::AutoText 
)
slot

Change the label's text, keeping all other QwtText attributes

参数
textNew text
textFormatFormat of text
参见
QwtText

◆ setText [2/2]

void QwtTextLabel::setText ( const QwtText text)
virtualslot

Change the label's text

参数
textNew text
参见
setText(), clear()

QwtLegendLabel 重载.

◆ sizeHint()

QSize QwtTextLabel::sizeHint ( ) const
overridevirtual

Return a size hint

返回
Size hint
参见
minimumSizeHint()

QwtLegendLabel 重载.

◆ text()

const QwtText & QwtTextLabel::text ( ) const

Return the text

返回
Current text
参见
setText(), plainText()

◆ textRect()

QRect QwtTextLabel::textRect ( ) const

Calculate geometry for the text in widget coordinates

返回
Geometry for the text
参见
drawText(), drawContents()

该类的文档由以下文件生成: