.TH "QwtLegend" 3 "Wed Jan 2 2019" "Version 6.1.4" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtLegend \- The legend widget\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtAbstractLegend\fP\&. .SS "Public Slots" .in +1c .ti -1c .RI "virtual void \fBupdateLegend\fP (const QVariant &, const QList< \fBQwtLegendData\fP > &)" .br .RI "Update the entries for an item\&. " .in -1c .SS "Signals" .in +1c .ti -1c .RI "void \fBclicked\fP (const QVariant &\fBitemInfo\fP, int index)" .br .ti -1c .RI "void \fBchecked\fP (const QVariant &\fBitemInfo\fP, bool on, int index)" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtLegend\fP (QWidget *parent=NULL)" .br .ti -1c .RI "virtual \fB~QwtLegend\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "void \fBsetMaxColumns\fP (uint numColums)" .br .RI "Set the maximum number of entries in a row\&. " .ti -1c .RI "uint \fBmaxColumns\fP () const" .br .ti -1c .RI "void \fBsetDefaultItemMode\fP (\fBQwtLegendData::Mode\fP)" .br .RI "Set the default mode for legend labels\&. " .ti -1c .RI "\fBQwtLegendData::Mode\fP \fBdefaultItemMode\fP () const" .br .ti -1c .RI "QWidget * \fBcontentsWidget\fP ()" .br .ti -1c .RI "const QWidget * \fBcontentsWidget\fP () const" .br .ti -1c .RI "QWidget * \fBlegendWidget\fP (const QVariant &) const" .br .ti -1c .RI "QList< QWidget * > \fBlegendWidgets\fP (const QVariant &) const" .br .ti -1c .RI "QVariant \fBitemInfo\fP (const QWidget *) const" .br .ti -1c .RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)" .br .ti -1c .RI "virtual QSize \fBsizeHint\fP () const" .br .RI "Return a size hint\&. " .ti -1c .RI "virtual int \fBheightForWidth\fP (int width) const" .br .ti -1c .RI "QScrollBar * \fBhorizontalScrollBar\fP () const" .br .ti -1c .RI "QScrollBar * \fBverticalScrollBar\fP () const" .br .ti -1c .RI "virtual void \fBrenderLegend\fP (QPainter *, const QRectF &, bool fillBackground) const" .br .ti -1c .RI "virtual void \fBrenderItem\fP (QPainter *, const QWidget *, const QRectF &, bool fillBackground) const" .br .ti -1c .RI "virtual bool \fBisEmpty\fP () const" .br .ti -1c .RI "virtual int \fBscrollExtent\fP (Qt::Orientation) const" .br .in -1c .SS "Protected Slots" .in +1c .ti -1c .RI "void \fBitemClicked\fP ()" .br .ti -1c .RI "void \fBitemChecked\fP (bool)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual QWidget * \fBcreateWidget\fP (const \fBQwtLegendData\fP &) const" .br .RI "Create a widget to be inserted into the legend\&. " .ti -1c .RI "virtual void \fBupdateWidget\fP (QWidget *widget, const \fBQwtLegendData\fP &)" .br .RI "Update the widget\&. " .in -1c .SH "Detailed Description" .PP The legend widget\&. The \fBQwtLegend\fP widget is a tabular arrangement of legend items\&. Legend items might be any type of widget, but in general they will be a \fBQwtLegendLabel\fP\&. .PP \fBSee also:\fP .RS 4 \fBQwtLegendLabel\fP, \fBQwtPlotItem\fP, \fBQwtPlot\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtLegend::QwtLegend (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP" Constructor .PP \fBParameters:\fP .RS 4 \fIparent\fP Parent widget .RE .PP .SH "Member Function Documentation" .PP .SS "void QwtLegend::checked (const QVariant & itemInfo, bool on, int index)\fC [signal]\fP" A signal which is emitted when the user has clicked on a legend label, which is in \fBQwtLegendData::Checkable\fP mode .PP \fBParameters:\fP .RS 4 \fIitemInfo\fP Info for the item of the selected legend label .br \fIindex\fP Index of the legend label in the list of widgets that are associated with the plot item .br \fIon\fP True when the legend label is checked .RE .PP \fBNote:\fP .RS 4 clicks are disabled as default .RE .PP \fBSee also:\fP .RS 4 \fBsetDefaultItemMode()\fP, \fBdefaultItemMode()\fP, \fBQwtPlot::itemToInfo()\fP .RE .PP .SS "void QwtLegend::clicked (const QVariant & itemInfo, int index)\fC [signal]\fP" A signal which is emitted when the user has clicked on a legend label, which is in \fBQwtLegendData::Clickable\fP mode\&. .PP \fBParameters:\fP .RS 4 \fIitemInfo\fP Info for the item item of the selected legend item .br \fIindex\fP Index of the legend label in the list of widgets that are associated with the plot item .RE .PP \fBNote:\fP .RS 4 clicks are disabled as default .RE .PP \fBSee also:\fP .RS 4 \fBsetDefaultItemMode()\fP, \fBdefaultItemMode()\fP, \fBQwtPlot::itemToInfo()\fP .RE .PP .SS "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\&. .PP \fBReturns:\fP .RS 4 Container widget of the legend items .RE .PP .SS "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\&. .PP \fBReturns:\fP .RS 4 Container widget of the legend items .RE .PP .SS "QWidget * QwtLegend::createWidget (const \fBQwtLegendData\fP & legendData) const\fC [protected]\fP, \fC [virtual]\fP" .PP Create a widget to be inserted into the legend\&. The default implementation returns a \fBQwtLegendLabel\fP\&. .PP \fBParameters:\fP .RS 4 \fIlegendData\fP Attributes of the legend entry .RE .PP \fBReturns:\fP .RS 4 Widget representing data on the legend .RE .PP \fBNote:\fP .RS 4 \fBupdateWidget()\fP will called soon after \fBcreateWidget()\fP with the same attributes\&. .RE .PP .SS "\fBQwtLegendData::Mode\fP QwtLegend::defaultItemMode () const" .PP \fBReturns:\fP .RS 4 Default item mode .RE .PP \fBSee also:\fP .RS 4 \fBsetDefaultItemMode()\fP .RE .PP .SS "bool QwtLegend::eventFilter (QObject * object, QEvent * event)\fC [virtual]\fP" Handle QEvent::ChildRemoved andQEvent::LayoutRequest events for the \fBcontentsWidget()\fP\&. .PP \fBParameters:\fP .RS 4 \fIobject\fP Object to be filtered .br \fIevent\fP Event .RE .PP \fBReturns:\fP .RS 4 Forwarded to QwtAbstractLegend::eventFilter() .RE .PP .SS "int QwtLegend::heightForWidth (int width) const\fC [virtual]\fP" .PP \fBReturns:\fP .RS 4 The preferred height, for a width\&. .RE .PP \fBParameters:\fP .RS 4 \fIwidth\fP Width .RE .PP .SS "QScrollBar * QwtLegend::horizontalScrollBar () const" .PP \fBReturns:\fP .RS 4 Horizontal scrollbar .RE .PP \fBSee also:\fP .RS 4 \fBverticalScrollBar()\fP .RE .PP .SS "bool QwtLegend::isEmpty () const\fC [virtual]\fP" .PP \fBReturns:\fP .RS 4 True, when no item is inserted .RE .PP .PP Implements \fBQwtAbstractLegend\fP\&. .SS "void QwtLegend::itemChecked (bool on)\fC [protected]\fP, \fC [slot]\fP" Called internally when the legend has been checked Emits a \fBchecked()\fP signal\&. .SS "void QwtLegend::itemClicked ()\fC [protected]\fP, \fC [slot]\fP" Called internally when the legend has been clicked on\&. Emits a \fBclicked()\fP signal\&. .SS "QVariant QwtLegend::itemInfo (const QWidget * widget) const" Find the item that is associated to a widget .PP \fBParameters:\fP .RS 4 \fIwidget\fP Widget on the legend .RE .PP \fBReturns:\fP .RS 4 Associated item info .RE .PP \fBSee also:\fP .RS 4 \fBlegendWidget()\fP .RE .PP .SS "QWidget * QwtLegend::legendWidget (const QVariant & itemInfo) const" .PP \fBReturns:\fP .RS 4 First widget in the list of widgets associated to an item .RE .PP \fBParameters:\fP .RS 4 \fIitemInfo\fP Info about an item .RE .PP \fBSee also:\fP .RS 4 \fBitemInfo()\fP, \fBQwtPlot::itemToInfo()\fP .RE .PP \fBNote:\fP .RS 4 Almost all types of items have only one widget .RE .PP .SS "QList< QWidget * > QwtLegend::legendWidgets (const QVariant & itemInfo) const" .PP \fBReturns:\fP .RS 4 List of widgets associated to a item .RE .PP \fBParameters:\fP .RS 4 \fIitemInfo\fP Info about an item .RE .PP \fBSee also:\fP .RS 4 \fBlegendWidget()\fP, \fBitemInfo()\fP, \fBQwtPlot::itemToInfo()\fP .RE .PP .SS "uint QwtLegend::maxColumns () const" .PP \fBReturns:\fP .RS 4 Maximum number of entries in a row .RE .PP \fBSee also:\fP .RS 4 \fBsetMaxColumns()\fP, \fBQwtDynGridLayout::maxColumns()\fP .RE .PP .SS "void QwtLegend::renderItem (QPainter * painter, const QWidget * widget, const QRectF & rect, bool fillBackground) const\fC [virtual]\fP" Render a legend entry into a given rectangle\&. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIwidget\fP Widget representing a legend entry .br \fIrect\fP Bounding rectangle .br \fIfillBackground\fP When true, fill rect with the widget background .RE .PP \fBNote:\fP .RS 4 When widget is not derived from \fBQwtLegendLabel\fP renderItem does nothing beside the background .RE .PP .SS "void QwtLegend::renderLegend (QPainter * painter, const QRectF & rect, bool fillBackground) const\fC [virtual]\fP" Render the legend into a given rectangle\&. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIrect\fP Bounding rectangle .br \fIfillBackground\fP When true, fill rect with the widget background .RE .PP \fBSee also:\fP .RS 4 \fBrenderLegend()\fP is used by \fBQwtPlotRenderer\fP - not by \fBQwtLegend\fP itself .RE .PP .PP Implements \fBQwtAbstractLegend\fP\&. .SS "int QwtLegend::scrollExtent (Qt::Orientation orientation) const\fC [virtual]\fP" Return the extent, that is needed for the scrollbars .PP \fBParameters:\fP .RS 4 \fIorientation\fP Orientation .RE .PP \fBReturns:\fP .RS 4 The width of the vertical scrollbar for Qt::Horizontal and v\&.v\&. .RE .PP .PP Reimplemented from \fBQwtAbstractLegend\fP\&. .SS "void QwtLegend::setDefaultItemMode (\fBQwtLegendData::Mode\fP mode)" .PP Set the default mode for legend labels\&. Legend labels will be constructed according to the attributes in a \fBQwtLegendData\fP object\&. When it doesn't contain a value for the QwtLegendData::ModeRole the label will be initialized with the default mode of the legend\&. .PP \fBParameters:\fP .RS 4 \fImode\fP Default item mode .RE .PP \fBSee also:\fP .RS 4 itemMode(), \fBQwtLegendData::value()\fP, \fBQwtPlotItem::legendData()\fP .RE .PP \fBNote:\fP .RS 4 Changing the mode doesn't have any effect on existing labels\&. .RE .PP .SS "void QwtLegend::setMaxColumns (uint numColums)" .PP 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 .PP \fBParameters:\fP .RS 4 \fInumColums\fP Maximum number of entries in a row .RE .PP \fBSee also:\fP .RS 4 \fBmaxColumns()\fP, \fBQwtDynGridLayout::setMaxColumns()\fP .RE .PP .SS "void QwtLegend::updateLegend (const QVariant & itemInfo, const QList< \fBQwtLegendData\fP > & legendData)\fC [virtual]\fP, \fC [slot]\fP" .PP Update the entries for an item\&. .PP \fBParameters:\fP .RS 4 \fIitemInfo\fP Info for an item .br \fIlegendData\fP List of legend entry attributes for the item .RE .PP .SS "void QwtLegend::updateWidget (QWidget * widget, const \fBQwtLegendData\fP & legendData)\fC [protected]\fP, \fC [virtual]\fP" .PP Update the widget\&. .PP \fBParameters:\fP .RS 4 \fIwidget\fP Usually a \fBQwtLegendLabel\fP .br \fIlegendData\fP Attributes to be displayed .RE .PP \fBSee also:\fP .RS 4 \fBcreateWidget()\fP .RE .PP \fBNote:\fP .RS 4 When widget is no \fBQwtLegendLabel\fP \fBupdateWidget()\fP does nothing\&. .RE .PP .SS "QScrollBar * QwtLegend::verticalScrollBar () const" .PP \fBReturns:\fP .RS 4 Vertical scrollbar .RE .PP \fBSee also:\fP .RS 4 \fBhorizontalScrollBar()\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.