Attributes of an entry on a legend
更多...
#include <qwt_legend_data.h>
|
|
| QwtLegendData () |
| | Constructor
|
| |
|
| QwtLegendData (const QwtLegendData &) |
| | Copy constructor
|
| |
|
| QwtLegendData (QwtLegendData &&) noexcept=default |
| |
|
| ~QwtLegendData () |
| | Destructor
|
| |
|
QwtLegendData & | operator= (const QwtLegendData &) |
| | Copy assignment
|
| |
|
QwtLegendData & | operator= (QwtLegendData &&) noexcept=default |
| |
| void | setValues (const QMap< int, QVariant > &) |
| | Set the legend attributes
|
| |
| const QMap< int, QVariant > & | values () const |
| | Return the legend attributes
|
| |
| void | setValue (int role, const QVariant &) |
| | Set an attribute value
|
| |
| QVariant | value (int role) const |
| | Return the attribute value for a specific role
|
| |
| bool | hasRole (int role) const |
| | Check if a value exists for a specific role
|
| |
| bool | isValid () const |
| | Check if the legend data is valid
|
| |
| QwtGraphic | icon () const |
| | Return the icon
|
| |
| QwtText | title () const |
| | Return the title
|
| |
| Mode | mode () const |
| | Return the mode
|
| |
Attributes of an entry on a legend
QwtLegendData is an abstract container (like QAbstractModel) to exchange attributes that are only known between the plot item and the legend. By overloading QwtPlotItem::legendData() any other set of attributes could be used that can be handled by a modified (or completely different) implementation of a legend.
- 参见
- QwtLegend, QwtPlotLegendItem
- 注解
- The stockchart example implements a legend as a tree with checkable items
◆ Mode
Mode defining how a legend entry interacts
| 枚举值 |
|---|
| ReadOnly | The legend item is not interactive, like a label
|
| Clickable | The legend item is clickable, like a push button
|
| Checkable | The legend item is checkable, like a checkable button
|
◆ Role
Identifier how to interpret a QVariant
| 枚举值 |
|---|
| ModeRole | The value is a Mode
|
| TitleRole | The value is a title
|
| IconRole | The value is an icon
|
| UserRole | Values < UserRole are reserved for internal use
|
◆ hasRole()
| bool QwtLegendData::hasRole |
( |
int |
role | ) |
const |
Check if a value exists for a specific role
- 参数
-
- 返回
- True, when the internal map has an entry for role
- 参见
- setValue(), value()
◆ icon()
Return the icon
- 返回
- Value of the IconRole attribute
- 参见
- title(), mode()
◆ isValid()
| bool QwtLegendData::isValid |
( |
| ) |
const |
◆ mode()
Return the mode
- 返回
- Value of the ModeRole attribute
-
ReadOnly when no mode is set
- 参见
- title(), icon()
◆ setValue()
| void QwtLegendData::setValue |
( |
int |
role, |
|
|
const QVariant & |
data |
|
) |
| |
Set an attribute value
- 参数
-
| role | Attribute role |
| data | Attribute value |
- 参见
- value()
◆ setValues()
| void QwtLegendData::setValues |
( |
const QMap< int, QVariant > & |
map | ) |
|
◆ title()
| QwtText QwtLegendData::title |
( |
| ) |
const |
Return the title
- 返回
- Value of the TitleRole attribute
- 参见
- icon(), mode()
◆ value()
| QVariant QwtLegendData::value |
( |
int |
role | ) |
const |
Return the attribute value for a specific role
- 参数
-
- 返回
- Attribute value for a specific role
- 参见
- setValue()
◆ values()
| const QMap< int, QVariant > & QwtLegendData::values |
( |
| ) |
const |
Return the legend attributes
- 返回
- Legend attributes
- 参见
- setValues()
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/plot/qwt_legend_data.h
- /home/runner/work/QWT/QWT/src/plot/qwt_legend_data.cpp