A widget representing an item on a QwtLegend
更多...
#include <qwt_legend_label.h>
|
|
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
|
| |
|
| | QwtLegendLabel (QWidget *parent=nullptr) |
| | Constructor for QwtLegendLabel
|
| |
| void | setData (const QwtLegendData &) |
| | Set the attributes of the legend label
|
| |
| const QwtLegendData & | data () 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
|
| |
| | 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 | 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
|
| |
|
| 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)
|
| |
| virtual void | drawContents (QPainter *) |
| | Draw the contents
|
| |
|
|
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 |
◆ checked
| void QwtLegendLabel::checked |
( |
bool |
| ) |
|
|
signal |
Signal emitted when the legend item has been toggled
- 参数
-
| on | True if checked, false otherwise |
◆ data()
◆ 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()
◆ 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 |
◆ setData()
Set the attributes of the legend label
- 参数
-
| legendData | Attributes 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 | ) |
|
◆ setItemMode()
◆ setSpacing()
| void QwtLegendLabel::setSpacing |
( |
int |
spacing | ) |
|
Change the spacing between icon and text
- 参数
-
- 参见
- spacing(), QwtTextLabel::margin()
◆ setText()
| void QwtLegendLabel::setText |
( |
const QwtText & |
text | ) |
|
|
overridevirtual |
◆ sizeHint()
| QSize QwtLegendLabel::sizeHint |
( |
| ) |
const |
|
overridevirtual |
◆ spacing()
| int QwtLegendLabel::spacing |
( |
| ) |
const |
Return the spacing between icon and text
- 返回
- Spacing between icon and text
- 参见
- setSpacing(), QwtTextLabel::margin()
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/plot/qwt_legend_label.h
- /home/runner/work/QWT/QWT/src/plot/qwt_legend_label.cpp