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

A widget representing an item on a QwtLegend 更多...

#include <qwt_legend_label.h>

类 QwtLegendLabel 继承关系图:
QwtTextLabel

class  PrivateData
 

Public 槽

void setChecked (bool on)
 Check/Uncheck the item
 
- Public 槽 继承自 QwtTextLabel
void setText (const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)
 Change the label's text, keeping all other QwtText attributes
 
void clear ()
 Clear the text and all QwtText attributes
 

信号

void clicked ()
 Signal emitted when the legend item has been clicked
 
void pressed ()
 Signal emitted when the legend item has been pressed
 
void released ()
 Signal emitted when the legend item has been released
 
void checked (bool)
 Signal emitted when the legend item has been toggled
 

Public 成员函数

 QwtLegendLabel (QWidget *parent=nullptr)
 Constructor for QwtLegendLabel
 
void setData (const QwtLegendData &)
 Set the attributes of the legend label
 
const QwtLegendDatadata () const
 Return the attributes of the label
 
void setItemMode (QwtLegendData::Mode)
 Set the item mode
 
QwtLegendData::Mode itemMode () const
 Return the item mode
 
void setSpacing (int spacing)
 Change the spacing between icon and text
 
int spacing () const
 Return the spacing between icon and text
 
virtual void setText (const QwtText &) override
 Set the text to the legend item
 
void setIcon (const QPixmap &)
 Assign the icon
 
QPixmap icon () const
 Return the pixmap representing a plot item
 
virtual QSize sizeHint () const override
 Return a size hint
 
bool isChecked () const
 Return true if the item is checked
 
- Public 成员函数 继承自 QwtTextLabel
 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 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 成员函数

void setDown (bool)
 Set whether the button is down (English only)
 
bool isDown () const
 Return whether the button is down (English only)
 
virtual void paintEvent (QPaintEvent *) override
 Handle paint events (English only)
 
virtual void mousePressEvent (QMouseEvent *) override
 Handle mouse press events (English only)
 
virtual void mouseReleaseEvent (QMouseEvent *) override
 Handle mouse release events (English only)
 
virtual void keyPressEvent (QKeyEvent *) override
 Handle key press events (English only)
 
virtual void keyReleaseEvent (QKeyEvent *) override
 Handle key release events (English only)
 
- Protected 成员函数 继承自 QwtTextLabel
virtual void drawContents (QPainter *)
 Draw the contents
 

额外继承的成员函数

- 属性 继承自 QwtTextLabel
int indent
 
int margin
 
QString plainText
 

详细描述

A widget representing an item on a QwtLegend

QwtLegendLabel is used to display legend items in a QwtLegend. It can show an icon and a text label, and supports different interaction modes (ReadOnly, Clickable, Checkable).

参见
QwtLegend, QwtLegendData

构造及析构函数说明

◆ QwtLegendLabel()

QwtLegendLabel::QwtLegendLabel ( QWidget *  parent = nullptr)
explicit

Constructor for QwtLegendLabel

参数
parentParent widget

Destructor

成员函数说明

◆ checked

void QwtLegendLabel::checked ( bool  )
signal

Signal emitted when the legend item has been toggled

参数
onTrue if checked, false otherwise

◆ data()

const QwtLegendData & QwtLegendLabel::data ( ) const

Return the attributes of the label

返回
Attributes of the label
参见
setData(), QwtPlotItem::legendData()

◆ icon()

QPixmap QwtLegendLabel::icon ( ) const

Return the pixmap representing a plot item

返回
Pixmap representing a plot item
参见
setIcon()

◆ isChecked()

bool QwtLegendLabel::isChecked ( ) const

Return true if the item is checked

返回
True if the item is checked

◆ isDown()

bool QwtLegendLabel::isDown ( ) const
protected

Return whether the button is down (English only)

Return true, if the item is down

◆ itemMode()

QwtLegendData::Mode QwtLegendLabel::itemMode ( ) const

Return the item mode

返回
Item mode
参见
setItemMode()

◆ keyPressEvent()

void QwtLegendLabel::keyPressEvent ( QKeyEvent *  e)
overrideprotectedvirtual

Handle key press events (English only)

Handle key press events

◆ keyReleaseEvent()

void QwtLegendLabel::keyReleaseEvent ( QKeyEvent *  e)
overrideprotectedvirtual

Handle key release events (English only)

Handle key release events

◆ mousePressEvent()

void QwtLegendLabel::mousePressEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Handle mouse press events (English only)

Handle mouse press events

◆ mouseReleaseEvent()

void QwtLegendLabel::mouseReleaseEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Handle mouse release events (English only)

Handle mouse release events

◆ paintEvent()

void QwtLegendLabel::paintEvent ( QPaintEvent *  e)
overrideprotectedvirtual

Handle paint events (English only)

Paint event

重载 QwtTextLabel .

◆ setChecked

void QwtLegendLabel::setChecked ( bool  on)
slot

Check/Uncheck the item

参数
oncheck/uncheck
参见
setItemMode()

◆ setData()

void QwtLegendLabel::setData ( const QwtLegendData legendData)

Set the attributes of the legend label

参数
legendDataAttributes of the label
参见
data()

◆ setDown()

void QwtLegendLabel::setDown ( bool  down)
protected

Set whether the button is down (English only)

Set the item being down

◆ setIcon()

void QwtLegendLabel::setIcon ( const QPixmap &  icon)

Assign the icon

参数
iconPixmap representing a plot item
参见
icon(), QwtPlotItem::legendIcon()

◆ setItemMode()

void QwtLegendLabel::setItemMode ( QwtLegendData::Mode  mode)

Set the item mode

The default is QwtLegendData::ReadOnly

参数
modeItem mode
参见
itemMode()

◆ setSpacing()

void QwtLegendLabel::setSpacing ( int  spacing)

Change the spacing between icon and text

参数
spacingSpacing
参见
spacing(), QwtTextLabel::margin()

◆ setText()

void QwtLegendLabel::setText ( const QwtText text)
overridevirtual

Set the text to the legend item

参数
textText label
参见
QwtTextLabel::text()

重载 QwtTextLabel .

◆ sizeHint()

QSize QwtLegendLabel::sizeHint ( ) const
overridevirtual

Return a size hint

返回
Size hint

重载 QwtTextLabel .

◆ spacing()

int QwtLegendLabel::spacing ( ) const

Return the spacing between icon and text

返回
Spacing between icon and text
参见
setSpacing(), QwtTextLabel::margin()

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