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

QwtAbstractLegend - Abstract base class for legend widgets.

#include <qwt_abstract_legend.h>

Inherits QFrame.

Inherited by QwtLegend.

virtual void updateLegend (const QVariant &itemInfo, const QList< QwtLegendData > &data)=0
Update the entries for a plot item.

QwtAbstractLegend (QWidget *parent=NULL)
virtual ~QwtAbstractLegend ()
Destructor. virtual void renderLegend (QPainter *painter, const QRectF &rect, bool fillBackground) const =0
virtual bool isEmpty () const =0
virtual int scrollExtent (Qt::Orientation) const

Abstract base class for legend widgets.

Legends, that need to be under control of the QwtPlot layout system need to be derived from QwtAbstractLegend.


Other type of legends can be implemented by connecting to the QwtPlot::legendDataChanged() signal. But as these legends are unknown to the plot layout system the layout code ( on screen and for QwtPlotRenderer ) need to be organized in application code.

See also


Definition at line 34 of file qwt_abstract_legend.h.



parent Parent widget

Definition at line 18 of file qwt_abstract_legend.cpp.


True, when no plot item is inserted

Implemented in QwtLegend.

Render the legend into a given rectangle.


painter Painter
rect Bounding rectangle
fillBackground When true, fill rect with the widget background

See also

renderLegend() is used by QwtPlotRenderer

Implemented in QwtLegend.

Return the extent, that is needed for elements to scroll the legend ( usually scrollbars ),


orientation Orientation


Extent of the corresponding scroll element

Reimplemented in QwtLegend.

Definition at line 35 of file qwt_abstract_legend.cpp.

Update the entries for a plot item.


itemInfo Info about an item
data List of legend entry attributes for the item

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

Sun Jul 18 2021 Version 6.2.0