QwtLegendData - Attributes of an entry on a legend.
Contents
Detailed Description
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.
Seealso:QwtLegend, QwtPlotLegendItemNote:
The stockchart example implements a legend as a tree with checkable items
Member Enumeration Documentation
enumQwtLegendData::Mode
Mode defining how a legend entry interacts.
EnumeratorReadOnly
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.
Member Function Documentation
boolQwtLegendData::hasRole(introle)constParameters:role Attribute role
Returns:
True, when the internal map has an entry for role
QwtGraphicQwtLegendData::icon()constReturns:
Value of the IconRole attribute
boolQwtLegendData::isValid()constReturns:
True, when the internal map is empty
QwtLegendData::ModeQwtLegendData::mode()constReturns:
Value of the ModeRole attribute
voidQwtLegendData::setValue(introle,constQVariant&data)
Set an attribute value
Parameters:role Attribute role
data Attribute value
Seealso:value()voidQwtLegendData::setValues(constQMap<int,QVariant>&map)
Set the legend attributes
QwtLegendData actually is a QMap<int, QVariant> with some convenience interfaces
Parameters:map Values
Seealso:values()QwtTextQwtLegendData::title()constReturns:
Value of the TitleRole attribute
QVariantQwtLegendData::value(introle)constParameters:role Attribute role
Returns:
Attribute value for a specific role
constQMap<int,QVariant>&QwtLegendData::values()constReturns:
Legend attributes
Seealso:setValues()Name
QwtLegendData - Attributes of an entry on a legend.
Synopsis
#include <qwt_legend_data.h>
PublicTypes
enum Mode { ReadOnly, Clickable, Checkable }
Mode defining how a legend entry interacts.
enum Role { ModeRole, TitleRole, IconRole, UserRole = 32 }
Identifier how to interprete a QVariant.
PublicMemberFunctionsQwtLegendData ()
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
QwtGraphicicon () const
QwtTexttitle () const
Modemode () const
