voidQwtLegend::checked(constQVariant&itemInfo,boolon,intindex)[signal]
A signal which is emitted when the user has clicked on a legend label, which is in
QwtLegendData::Checkable mode
Parameters:itemInfo Info for the item of the selected legend label
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:
clicks are disabled as default
Seealso:setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo()voidQwtLegend::clicked(constQVariant&itemInfo,intindex)[signal]
A signal which is emitted when the user has clicked on a legend label, which is in
QwtLegendData::Clickable mode.
Parameters:itemInfo Info for the item item of the selected legend item
index Index of the legend label in the list of widgets that are associated with the plot item
Note:
clicks are disabled as default
Seealso:setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo()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:
Container widget of the legend items
constQWidget*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:
Container widget of the legend items
QWidget*QwtLegend::createWidget(constQwtLegendData&legendData)const[protected],[virtual]
Create a widget to be inserted into the legend. The default implementation returns a QwtLegendLabel.
Parameters:legendData Attributes of the legend entry
Returns:
Widget representing data on the legend
Note:updateWidget() will called soon after createWidget() with the same attributes.
QwtLegendData::ModeQwtLegend::defaultItemMode()constReturns:
Default item mode
Seealso:setDefaultItemMode()boolQwtLegend::eventFilter(QObject*object,QEvent*event)[virtual]
Handle QEvent::ChildRemoved andQEvent::LayoutRequest events for the contentsWidget().
Parameters:object Object to be filtered
event Event
Returns:
Forwarded to QwtAbstractLegend::eventFilter()
intQwtLegend::heightForWidth(intwidth)const[virtual]Returns:
The preferred height, for a width.
Parameters:width Width
QScrollBar*QwtLegend::horizontalScrollBar()constReturns:
Horizontal scrollbar
Seealso:verticalScrollBar()boolQwtLegend::isEmpty()const[virtual]Returns:
True, when no item is inserted
Implements QwtAbstractLegend.
voidQwtLegend::itemChecked(boolon)[protected],[slot]
Called internally when the legend has been checked Emits a checked() signal.
voidQwtLegend::itemClicked()[protected],[slot]
Called internally when the legend has been clicked on. Emits a clicked() signal.
QVariantQwtLegend::itemInfo(constQWidget*widget)const
Find the item that is associated to a widget
Parameters:widget Widget on the legend
Returns:
Associated item info
Seealso:legendWidget()QWidget*QwtLegend::legendWidget(constQVariant&itemInfo)constReturns:
First widget in the list of widgets associated to an item
Parameters:itemInfo Info about an item
Seealso:itemInfo(), QwtPlot::itemToInfo()Note:
Almost all types of items have only one widget
QList<QWidget*>QwtLegend::legendWidgets(constQVariant&itemInfo)constReturns:
List of widgets associated to a item
Parameters:itemInfo Info about an item
Seealso:legendWidget(), itemInfo(), QwtPlot::itemToInfo()uintQwtLegend::maxColumns()constReturns:
Maximum number of entries in a row
Seealso:setMaxColumns(), QwtDynGridLayout::maxColumns()voidQwtLegend::renderItem(QPainter*painter,constQWidget*widget,constQRectF&rect,boolfillBackground)const[virtual]
Render a legend entry into a given rectangle.
Parameters:painter Painter
widget Widget representing a legend entry
rect Bounding rectangle
fillBackground When true, fill rect with the widget background
Note:
When widget is not derived from QwtLegendLabel renderItem does nothing beside the background
voidQwtLegend::renderLegend(QPainter*painter,constQRectF&rect,boolfillBackground)const[virtual]
Render the legend into a given rectangle.
Parameters:painter Painter
rect Bounding rectangle
fillBackground When true, fill rect with the widget background
Seealso:renderLegend() is used by QwtPlotRenderer - not by QwtLegend itself
Implements QwtAbstractLegend.
intQwtLegend::scrollExtent(Qt::Orientationorientation)const[virtual]
Return the extent, that is needed for the scrollbars
Parameters:orientation Orientation
Returns:
The width of the vertical scrollbar for Qt::Horizontal and v.v.
Reimplemented from QwtAbstractLegend.
voidQwtLegend::setDefaultItemMode(QwtLegendData::Modemode)
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:mode Default item mode
Seealso:
itemMode(), QwtLegendData::value(), QwtPlotItem::legendData()Note:
Changing the mode doesn't have any effect on existing labels.
voidQwtLegend::setMaxColumns(uintnumColums)
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:numColums Maximum number of entries in a row
Seealso:maxColumns(), QwtDynGridLayout::setMaxColumns()voidQwtLegend::updateLegend(constQVariant&itemInfo,constQList<QwtLegendData>&legendData)[virtual],[slot]
Update the entries for an item.
Parameters:itemInfo Info for an item
legendData List of legend entry attributes for the item
voidQwtLegend::updateWidget(QWidget*widget,constQwtLegendData&legendData)[protected],[virtual]
Update the widget.
Parameters:widget Usually a QwtLegendLabellegendData Attributes to be displayed
Seealso:createWidget()Note:
When widget is no QwtLegendLabelupdateWidget() does nothing.
QScrollBar*QwtLegend::verticalScrollBar()constReturns:
Vertical scrollbar
Seealso:horizontalScrollBar()