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 interpret a QVariant. More... | |
Public Member Functions | |
bool | hasRole (int role) const |
QwtGraphic | icon () const |
bool | isValid () const |
Mode | mode () const |
QwtLegendData () | |
Constructor. More... | |
void | setValue (int role, const QVariant &) |
void | setValues (const QMap< int, QVariant > &) |
QwtText | title () const |
QVariant | value (int role) const |
const QMap< int, QVariant > & | values () const |
~QwtLegendData () | |
Destructor. More... | |
Private Attributes | |
QMap< int, QVariant > | m_map |
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.
Definition at line 36 of file qwt_legend_data.h.
enum QwtLegendData::Mode |
Mode defining how a legend entry interacts.
Enumerator | |
---|---|
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. |
Definition at line 40 of file qwt_legend_data.h.
enum QwtLegendData::Role |
Identifier how to interpret a QVariant.
Enumerator | |
---|---|
ModeRole | |
TitleRole | |
IconRole | |
UserRole |
Definition at line 53 of file qwt_legend_data.h.
QwtLegendData::QwtLegendData | ( | ) |
Constructor.
Definition at line 15 of file qwt_legend_data.cpp.
QwtLegendData::~QwtLegendData | ( | ) |
Destructor.
Definition at line 20 of file qwt_legend_data.cpp.
bool QwtLegendData::hasRole | ( | int | role | ) | const |
role | Attribute role |
Definition at line 51 of file qwt_legend_data.cpp.
QwtGraphic QwtLegendData::icon | ( | ) | const |
Definition at line 106 of file qwt_legend_data.cpp.
bool QwtLegendData::isValid | ( | ) | const |
Definition at line 82 of file qwt_legend_data.cpp.
QwtLegendData::Mode QwtLegendData::mode | ( | ) | const |
Definition at line 120 of file qwt_legend_data.cpp.
void QwtLegendData::setValue | ( | int | role, |
const QVariant & | data | ||
) |
Set an attribute value
role | Attribute role |
data | Attribute value |
Definition at line 64 of file qwt_legend_data.cpp.
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 |
Definition at line 33 of file qwt_legend_data.cpp.
QwtText QwtLegendData::title | ( | ) | const |
Definition at line 88 of file qwt_legend_data.cpp.
QVariant QwtLegendData::value | ( | int | role | ) | const |
role | Attribute role |
Definition at line 73 of file qwt_legend_data.cpp.
const QMap< int, QVariant > & QwtLegendData::values | ( | ) | const |
|
private |
Definition at line 85 of file qwt_legend_data.h.