QwtLegend(3)
π QwtLegend β straight from the Qwt User's Guide π
okay so bestie, pull up a chair π«Ά this whole page lives in the Qwt User's Guide manual, and it's all about one little widget that's secretly carrying the whole plot. let's get into it β¨
πΈ NAME πΈ
QwtLegend β that's it, that's the name. the legend widget itself. iconic behavior honestly π
β¨ SYNOPSIS β¨
first things first, you gotta let the compiler know you want in:
#include <qwt_legend.h>
π Public Types π
two enums, both absolute main characters:
enum LegendDisplayPolicy { NoIdentifier = 0, FixedIdentifier = 1,
AutoIdentifier = 2 }
enum LegendItemMode { ReadOnlyItem, ClickableItem, CheckableItem }
π Public Member Functions π
the full roster, no cap, nobody gets left out:
QwtLegend (QWidget *parent=NULL)
virtual ~QwtLegend ()
void clear ()
QWidget * contentsWidget ()
const QWidget * contentsWidget () const
LegendDisplayPolicy displayPolicy () const
virtual bool eventFilter (QObject *, QEvent *)
QWidget * find (const QwtLegendItemManager *) const
QwtLegendItemManager * find (const QWidget *) const
virtual int heightForWidth (int w) const
QScrollBar * horizontalScrollBar () const
int identifierMode () const
void insert (const QwtLegendItemManager *, QWidget *)
bool isEmpty () const
uint itemCount () const
LegendItemMode itemMode () const
virtual QList< QWidget * > legendItems () const
void remove (const QwtLegendItemManager *)
void setDisplayPolicy (LegendDisplayPolicy policy, int mode)
void setItemMode (LegendItemMode)
virtual QSize sizeHint () const
QScrollBar * verticalScrollBar () const
π¦ Protected Member Functions π¦
the backstage crew, only your subclasses get to hang with them:
virtual void layoutContents ()
virtual void resizeEvent (QResizeEvent *)
π Detailed Description π
The legend widget.
The QwtLegend widget is a tabular arrangement of legend items. and like⦠what even is a legend item? plot twist: it might be any type of widget, literally anything. but in general, bestie, they're gonna be a QwtLegendItem.
See also: QwtLegendItem, QwtLegendItemManager, QwtPlot β the little friend group iykyk π
π Member Enumeration Documentation π
π enum QwtLegend::LegendDisplayPolicy
Display policy. here's the vibe check on all three:
NoIdentifierβ The client code is responsible how to display of each legend item. The Qwt library will not interfere. (so it's giving "you're on your own, bestie, we're not touching that" π)FixedIdentifierβ All legend items are displayed with theQwtLegendItem::IdentifierModeto be passed inmode.AutoIdentifierβ Each legend item is displayed with a mode that is a bitwise or of:QwtLegendItem::ShowLine(if its curve is drawn with a line) andQwtLegendItem::ShowSymbol(if its curve is drawn with symbols) andQwtLegendItem::ShowText(if the has a title).
Default is AutoIdentifier. she's the default for a reason π
See also: setDisplayPolicy(), displayPolicy(), QwtLegendItem::IdentifierMode
π§ enum QwtLegend::LegendItemMode
Interaction mode for the legend items. choose your fighter:
ReadOnlyItemβ The legend item is not interactive, like a labelClickableItemβ The legend item is clickable, like a push buttonCheckableItemβ The legend item is checkable, like a checkable button
Default is ReadOnlyItem. she just sits there and looks pretty, no thoughts, head empty πΈ
See also: setItemMode(), itemMode(), QwtLegendItem::IdentifierMode, QwtLegendItem::clicked(), QwtLegendItem::checked(), QwtPlot::legendClicked(), QwtPlot::legendChecked()
π«Ά Constructor & Destructor Documentation π«Ά
π« QwtLegend::QwtLegend (QWidget *parent = NULL) [explicit]
Constructor. yes bestie, we're being [explicit] about it, no sneaky implicit conversions around here.
Parameters:
parentβ Parent widget
π₯ Member Function Documentation π₯
β QWidget * QwtLegend::contentsWidget ()
The contents widget is the only child of the viewport() and the parent widget of all legend items.
β const QWidget * QwtLegend::contentsWidget () const
The contents widget is the only child of the viewport() and the parent widget of all legend items.
(yes, same energy, one's just const β she promised not to touch anything π€)
π QwtLegend::LegendDisplayPolicy QwtLegend::displayPolicy () const
Returns: the legend display policy. Default is LegendDisplayPolicy::Auto.
See also: setDisplayPolicy(), LegendDisplayPolicy
π bool QwtLegend::eventFilter (QObject *o, QEvent *e) [virtual]
Filter layout related events of QwtLegend::contentsWidget().
Parameters:
oβ Object to be filteredeβ Event
πΈ QWidget * QwtLegend::find (const QwtLegendItemManager *plotItem) const
Find the widget that represents a plot item.
Parameters:
plotItemβ Plot item
Returns: Widget on the legend, or NULL
πΈ QwtLegendItemManager * QwtLegend::find (const QWidget *legendItem) const
Find the widget that represents a plot item.
Parameters:
legendItemβ Legend item
Returns: Widget on the legend, or NULL
π¦ int QwtLegend::heightForWidth (intwidth) const [virtual]
Returns: The preferred height, for the width w.
Parameters:
widthβ Width
π QScrollBar * QwtLegend::horizontalScrollBar () const
Returns: Horizontal scrollbar
See also: verticalScrollBar()
β¨ int QwtLegend::identifierMode () const
Returns: the IdentifierMode to be used in combination with LegendDisplayPolicy::Fixed.
Default is ShowLine | ShowSymbol | ShowText.
π void QwtLegend::insert (const QwtLegendItemManager *plotItem, QWidget *legendItem)
Insert a new item for a plot item.
Parameters:
plotItemβ Plot itemlegendItemβ New legend item
Note: The parent ofitemwill be changed toQwtLegend::contentsWidget()β so heads up, your widget is getting re-parented, no take-backs π
π QwtLegend::LegendItemMode QwtLegend::itemMode () const
See also: LegendItemMode
πΏ void QwtLegend::layoutContents () [protected], [virtual]
Adjust contents widget and item layout to the size of the viewport().
π§ void QwtLegend::remove (const QwtLegendItemManager *plotItem)
Find the corresponding item for a plotItem and remove it from the item list.
Parameters:
plotItemβ Plot item
β void QwtLegend::resizeEvent (QResizeEvent *e) [protected], [virtual]
Resize event.
Parameters:
eβ Resize event
π void QwtLegend::setDisplayPolicy (LegendDisplayPolicypolicy, intmode)
Set the legend display policy to:
Parameters:
policyβ Legend display policymodeβ Identifier mode (or'dShowLine,ShowSymbol,ShowText)
See also: displayPolicy(), LegendDisplayPolicy
π void QwtLegend::setItemMode (LegendItemModemode)
See also: LegendItemMode
π« QScrollBar * QwtLegend::verticalScrollBar () const
Returns: Vertical scrollbar
See also: horizontalScrollBar()
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code.
okay and that's the whole page, bestie!! π₯³ thanks for reading all the way through, you ate that fr fr π β¨ this was Version 5.2.3, dated Tue Nov 20 2012 β yeah she's vintage, she's a classic, we stan an elder icon ππ¦ byeeee π«Ά
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms