- bookworm 6.1.4-2
- testing 6.1.4-2
- unstable 6.1.4-2
- experimental 6.2.0-1
QwtLegend(3) | Qwt User's Guide | QwtLegend(3) |
NAME¶
QwtLegend - The legend widget.
SYNOPSIS¶
#include <qwt_legend.h>
Inherits QwtAbstractLegend.
Public Slots¶
virtual void updateLegend (const QVariant &, const
QList< QwtLegendData > &) override
Update the entries for an item.
Signals¶
void clicked (const QVariant &itemInfo, int
index)
void checked (const QVariant &itemInfo, bool on, int index)
Public Member Functions¶
QwtLegend (QWidget *parent=NULL)
virtual ~QwtLegend ()
Destructor. void setMaxColumns (uint numColums)
Set the maximum number of entries in a row. uint maxColumns () const
void setDefaultItemMode (QwtLegendData::Mode)
Set the default mode for legend labels. QwtLegendData::Mode
defaultItemMode () const
QWidget * contentsWidget ()
const QWidget * contentsWidget () const
QWidget * legendWidget (const QVariant &) const
QList< QWidget * > legendWidgets (const QVariant &)
const
QVariant itemInfo (const QWidget *) const
virtual bool eventFilter (QObject *, QEvent *) override
virtual QSize sizeHint () const override
Return a size hint. virtual int heightForWidth (int w) const override
QScrollBar * horizontalScrollBar () const
QScrollBar * verticalScrollBar () const
virtual void renderLegend (QPainter *, const QRectF &, bool
fillBackground) const override
virtual void renderItem (QPainter *, const QWidget *, const QRectF
&, bool fillBackground) const
virtual bool isEmpty () const override
virtual int scrollExtent (Qt::Orientation) const override
Protected Slots¶
void itemClicked ()
void itemChecked (bool)
Protected Member Functions¶
virtual QWidget * createWidget (const QwtLegendData
&) const
Create a widget to be inserted into the legend. virtual void
updateWidget (QWidget *, const QwtLegendData &)
Update the widget.
Detailed Description¶
The legend widget.
The QwtLegend widget is a tabular arrangement of legend items. Legend items might be any type of widget, but in general they will be a QwtLegendLabel.
See also
Definition at line 31 of file qwt_legend.h.
Constructor & Destructor Documentation¶
QwtLegend::QwtLegend (QWidget * parent = NULL) [explicit]¶
Constructor
Parameters
Definition at line 258 of file qwt_legend.cpp.
Member Function Documentation¶
void QwtLegend::checked (const QVariant & itemInfo, bool on, int index) [signal]¶
A signal which is emitted when the user has clicked on a legend label, which is in QwtLegendData::Checkable mode
Parameters
index Index of the legend label in the list of widgets that are associated with the plot item
on True when the legend label is checked
Note
See also
void QwtLegend::clicked (const QVariant & itemInfo, int index) [signal]¶
A signal which is emitted when the user has clicked on a legend label, which is in QwtLegendData::Clickable mode.
Parameters
index Index of the legend label in the list of widgets that are associated with the plot item
Note
See also
QWidget * QwtLegend::contentsWidget ()¶
The contents widget is the only child of the viewport of the internal QScrollArea and the parent widget of all legend items.
Returns
Definition at line 355 of file qwt_legend.cpp.
const QWidget * QwtLegend::contentsWidget () const¶
The contents widget is the only child of the viewport of the internal QScrollArea and the parent widget of all legend items.
Returns
Definition at line 385 of file qwt_legend.cpp.
QWidget * QwtLegend::createWidget (const QwtLegendData & legendData) const [protected], [virtual]¶
Create a widget to be inserted into the legend. The default implementation returns a QwtLegendLabel.
Parameters
Returns
Note
Definition at line 467 of file qwt_legend.cpp.
QwtLegendData::Mode QwtLegend::defaultItemMode () const¶
Returns
See also
Definition at line 344 of file qwt_legend.cpp.
bool QwtLegend::eventFilter (QObject * object, QEvent * event) [override], [virtual]¶
Handle QEvent::ChildRemoved and QEvent::LayoutRequest events for the contentsWidget().
Parameters
event Event
Returns
Definition at line 559 of file qwt_legend.cpp.
int QwtLegend::heightForWidth (int width) const [override], [virtual]¶
Returns
Parameters
Definition at line 538 of file qwt_legend.cpp.
QScrollBar * QwtLegend::horizontalScrollBar () const¶
Returns
See also
Definition at line 364 of file qwt_legend.cpp.
bool QwtLegend::isEmpty () const [override], [virtual]¶
Returns
Implements QwtAbstractLegend.
Definition at line 810 of file qwt_legend.cpp.
void QwtLegend::itemChecked (bool on) [protected], [slot]¶
Called internally when the legend has been checked Emits a checked() signal.
Definition at line 638 of file qwt_legend.cpp.
void QwtLegend::itemClicked () [protected], [slot]¶
Called internally when the legend has been clicked on. Emits a clicked() signal.
Definition at line 616 of file qwt_legend.cpp.
QVariant QwtLegend::itemInfo (const QWidget * widget) const¶
Find the item that is associated to a widget
Parameters
Returns
See also
Definition at line 804 of file qwt_legend.cpp.
QWidget * QwtLegend::legendWidget (const QVariant & itemInfo) const¶
Returns
Parameters
See also
Note
Definition at line 788 of file qwt_legend.cpp.
QList< QWidget * > QwtLegend::legendWidgets (const QVariant & itemInfo) const¶
Returns
Parameters
See also
Definition at line 777 of file qwt_legend.cpp.
uint QwtLegend::maxColumns () const¶
Returns
See also
Definition at line 310 of file qwt_legend.cpp.
void QwtLegend::renderItem (QPainter * painter, const QWidget * widget, const QRectF & rect, bool fillBackground) const [virtual]¶
Render a legend entry into a given rectangle.
Parameters
widget Widget representing a legend entry
rect Bounding rectangle
fillBackground When true, fill rect with the widget background
Note
Definition at line 727 of file qwt_legend.cpp.
void QwtLegend::renderLegend (QPainter * painter, const QRectF & rect, bool fillBackground) const [override], [virtual]¶
Render the legend into a given rectangle.
Parameters
rect Bounding rectangle
fillBackground When true, fill rect with the widget background
See also
Implements QwtAbstractLegend.
Definition at line 665 of file qwt_legend.cpp.
int QwtLegend::scrollExtent (Qt::Orientation orientation) const [override], [virtual]¶
Return the extent, that is needed for the scrollbars
Parameters
Returns
Reimplemented from QwtAbstractLegend.
Definition at line 821 of file qwt_legend.cpp.
void QwtLegend::setDefaultItemMode (QwtLegendData::Mode mode)¶
Set the default mode for legend labels. Legend labels will be constructed according to the attributes in a QwtLegendData object. When it doesn't contain a value for the QwtLegendData::ModeRole the label will be initialized with the default mode of the legend.
Parameters
See also
Note
Definition at line 335 of file qwt_legend.cpp.
void QwtLegend::setMaxColumns (uint numColums)¶
Set the maximum number of entries in a row. F.e when the maximum is set to 1 all items are aligned vertically. 0 means unlimited
Parameters
See also
Definition at line 296 of file qwt_legend.cpp.
void QwtLegend::updateLegend (const QVariant & itemInfo, const QList< QwtLegendData > & legendData) [override], [virtual], [slot]¶
Update the entries for an item.
Parameters
legendData List of legend entry attributes for the item
Definition at line 396 of file qwt_legend.cpp.
void QwtLegend::updateWidget (QWidget * widget, const QwtLegendData & legendData) [protected], [virtual]¶
Update the widget.
Parameters
legendData Attributes to be displayed
See also
Note
Definition at line 489 of file qwt_legend.cpp.
QScrollBar * QwtLegend::verticalScrollBar () const¶
Returns
See also
Definition at line 373 of file qwt_legend.cpp.
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |