QwtLegendData(3)
π QwtLegendData(3) β Library Functions Manual β¨
okay bestie, welcome to the Library Functions Manual era of your life π this is QwtLegendData, and it's lowkey iconic.
πΈ NAME πΈ
QwtLegendData β literally the attributes of an entry on a legend. that's the whole vibe.
β¨ SYNOPSIS β¨
#include <qwt_legend_data.h>
π«Ά Public Types
enum Mode { ReadOnly, Clickable, Checkable }β the Mode that defines how a legend entry interacts with you πenum Role { ModeRole, TitleRole, IconRole, UserRole = 32 }β the identifier for how to interpret aQVariant
π¦ Public Member Functions
QwtLegendData ()β Constructor π~QwtLegendData ()β Destructorvoid setValues (const QMap< int, QVariant > &)const QMap< int, QVariant > & values () constvoid setValue (int role, const QVariant &)QVariant value (int role) constbool hasRole (int role) constbool isValid () constQwtGraphic icon () constQwtText title () constMode mode () const
π Detailed Description π
Attributes of an entry on a legend. main character behavior fr.
QwtLegendData is an abstract container ( like QAbstractModel ) whose whole job is exchanging attributes β and those attributes are only known between the plot item and the legend. like, it's the group chat between them π«Ά
and here's the slay part: by overloading QwtPlotItem::legendData() you can use any other set of attributes, as long as a modified ( or completely different ) implementation of a legend can handle them. customization queen π
See also:QwtLegend,QwtPlotLegendItem
Note: the stockchart example implements a legend as a tree with checkable items π³
Definition at line 36 of file qwt_legend_data.h.
π Member Enumeration Documentation π
enum QwtLegendData::Mode
Mode defining how a legend entry interacts. periodt.
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 π§
Definition at line 53 of file qwt_legend_data.h.
π Constructor & Destructor Documentation π
QwtLegendData::QwtLegendData ()
Constructor. she's born π
Definition at line 15 of file qwt_legend_data.cpp.
QwtLegendData::~QwtLegendData ()
Destructor. she's gone π
Definition at line 20 of file qwt_legend_data.cpp.
β Member Function Documentation β
bool QwtLegendData::hasRole (int role) const
Parameters:
- role β Attribute role
Returns: True, when the internal map has an entry for role β
Definition at line 51 of file qwt_legend_data.cpp.
QwtGraphic QwtLegendData::icon () const
Returns: Value of the IconRole attribute πΌοΈ
Definition at line 106 of file qwt_legend_data.cpp.
bool QwtLegendData::isValid () const
Returns: True, when the internal map is empty (yep, that's what it says, no cap) π
Definition at line 82 of file qwt_legend_data.cpp.
QwtLegendData::Mode QwtLegendData::mode () const
Returns: Value of the ModeRole attribute ποΈ
Definition at line 120 of file qwt_legend_data.cpp.
void QwtLegendData::setValue (int role, const QVariant & data)
Set an attribute value βοΈ
Parameters:
- role β Attribute role
- data β Attribute value
See also: value()
Definition at line 64 of file qwt_legend_data.cpp.
void QwtLegendData::setValues (const QMap< int, QVariant > & map)
Set the legend attributes.
plot twist π«’ QwtLegendData actually is a QMap<int, QVariant> with some convenience interfaces. she's not like a map, she is the map.
Parameters:
- map β Values
See also: values()
Definition at line 33 of file qwt_legend_data.cpp.
QwtText QwtLegendData::title () const
Returns: Value of the TitleRole attribute π
Definition at line 88 of file qwt_legend_data.cpp.
QVariant QwtLegendData::value (int role) const
Parameters:
- role β Attribute role
Returns: Attribute value for a specific role π―
Definition at line 73 of file qwt_legend_data.cpp.
const QMap< int, QVariant > & QwtLegendData::values () const
Returns: Legend attributes π«
See also: setValues()
Definition at line 42 of file qwt_legend_data.cpp.
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code.
and that's the whole page bestie π generated automatically by Doxygen for Qwt User's Guide β this was QwtLegendData(3), catch you on the next manpage π
β¨π¦
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms