QwtLegendData(3) Qwt User's Guide QwtLegendData(3)

QwtLegendData - Attributes of an entry on a legend.

#include <qwt_legend_data.h>


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.


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.

See also:

QwtLegend, QwtPlotLegendItem

Note:

The stockchart example implements a legend as a tree with checkable items

Mode defining how a legend entry interacts.

Enumerator

The legend item is not interactive, like a label.
The legend item is clickable, like a push button.
The legend item is checkable, like a checkable button.

Parameters:

role Attribute role

Returns:

True, when the internal map has an entry for role

QwtGraphic QwtLegendData::icon () const

Returns:

Value of the IconRole attribute

Returns:

True, when the internal map is empty

QwtLegendData::Mode QwtLegendData::mode () const

Returns:

Value of the ModeRole attribute

Set an attribute value

Parameters:

role Attribute role
data Attribute value

See also:

value()

Set the legend attributes

QwtLegendData actually is a QMap<int, QVariant> with some convenience interfaces

Parameters:

map Values

See also:

values()

QwtText QwtLegendData::title () const

Returns:

Value of the TitleRole attribute

Parameters:

role Attribute role

Returns:

Attribute value for a specific role

Returns:

Legend attributes

See also:

setValues()

Generated automatically by Doxygen for Qwt User's Guide from the source code.

Wed Jan 2 2019 Version 6.1.4