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 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

πŸ’œ 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