Attributes of an entry on a legend. More...
#include <qwt_legend_data.h>
Public Types | |
| enum | Mode { ReadOnly, Clickable, Checkable } |
| Mode defining how a legend entry interacts. More... | |
| enum | Role { ModeRole, TitleRole, IconRole, UserRole = 32 } |
| Identifier how to interprete a QVariant. | |
Public Member Functions | |
| QwtLegendData () | |
| Constructor. | |
| ~QwtLegendData () | |
| Destructor. | |
| void | setValues (const QMap< int, QVariant > &) |
| const QMap< int, QVariant > & | values () const |
| void | setValue (int role, const QVariant &) |
| QVariant | value (int role) const |
| bool | hasRole (int role) const |
| bool | isValid () const |
| QwtGraphic | icon () const |
| QwtText | title () const |
| Mode | mode () const |
Attributes of an entry on a legend.
QwtLegendData is an abstract container ( like QAbstractModel ) to exchange attributes, that are only known between to 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.
| enum QwtLegendData::Mode |
| bool QwtLegendData::hasRole | ( | int | role | ) | const |
| role | Attribute role |
| QwtGraphic QwtLegendData::icon | ( | ) | const |
| bool QwtLegendData::isValid | ( | ) | const |
| QwtLegendData::Mode QwtLegendData::mode | ( | ) | const |
| void QwtLegendData::setValue | ( | int | role, |
| const QVariant & | data | ||
| ) |
| void QwtLegendData::setValues | ( | const QMap< int, QVariant > & | map | ) |
Set the legend attributes
QwtLegendData actually is a QMap<int, QVariant> with some convenience interfaces
| map | Values |
| QwtText QwtLegendData::title | ( | ) | const |
| QVariant QwtLegendData::value | ( | int | role | ) | const |
| role | Attribute role |
| const QMap< int, QVariant > & QwtLegendData::values | ( | ) | const |
1.8.5