QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
QwtLegend Class Reference

The legend widget. More...

#include <qwt_legend.h>

Inheritance diagram for QwtLegend:
QwtAbstractLegend

Classes

class  PrivateData
 

Public Slots

virtual void updateLegend (const QVariant &, const QList< QwtLegendData > &) override
 Update the entries for an item.
 
- Public Slots inherited from QwtAbstractLegend
virtual void updateLegend (const QVariant &itemInfo, const QList< QwtLegendData > &data)=0
 Update the entries for a plot item.
 

Signals

void clicked (const QVariant &itemInfo, int index)
 Signal emitted when the user clicks on a legend label in Clickable mode.
 
void checked (const QVariant &itemInfo, bool on, int index)
 Signal emitted when the user clicks on a legend label in Checkable mode.
 

Public Member Functions

 QwtLegend (QWidget *parent=nullptr)
 Constructor for QwtLegend.
 
virtual ~QwtLegend ()
 Destructor .
 
void setMaxColumns (uint numColums)
 Set the maximum number of entries in a row.
 
uint maxColumns () const
 Return the maximum number of entries in a row.
 
void setDefaultItemMode (QwtLegendData::Mode)
 Set the default mode for legend labels.
 
QwtLegendData::Mode defaultItemMode () const
 Return the default item mode.
 
QWidget * contentsWidget ()
 Return the contents widget.
 
const QWidget * contentsWidget () const
 Return the contents widget (const version)
 
QWidget * legendWidget (const QVariant &) const
 Return first widget in the list of widgets associated to an item.
 
QList< QWidget * > legendWidgets (const QVariant &) const
 Return list of widgets associated to an item.
 
QVariant itemInfo (const QWidget *) const
 Find the item that is associated to a widget.
 
virtual bool eventFilter (QObject *, QEvent *) override
 Handle QEvent::ChildRemoved and QEvent::LayoutRequest events.
 
virtual QSize sizeHint () const override
 Return a size hint.
 
virtual int heightForWidth (int w) const override
 Return the preferred height for a given width.
 
QScrollBar * horizontalScrollBar () const
 Return the horizontal scrollbar.
 
QScrollBar * verticalScrollBar () const
 Return the vertical scrollbar.
 
virtual void renderLegend (QPainter *, const QRectF &, bool fillBackground) const override
 Render the legend into a given rectangle.
 
virtual void renderItem (QPainter *, const QWidget *, const QRectF &, bool fillBackground) const
 Render a legend entry into a given rectangle.
 
virtual bool isEmpty () const override
 Check if the legend is empty.
 
virtual int scrollExtent (Qt::Orientation) const override
 Return the extent that is needed for the scrollbars.
 
- Public Member Functions inherited from QwtAbstractLegend
 QwtAbstractLegend (QWidget *parent=nullptr)
 Constructor for QwtAbstractLegend.
 
virtual ~QwtAbstractLegend ()
 Destructor for QwtAbstractLegend .
 

Protected Slots

void itemClicked ()
 Called internally when the legend has been clicked on.
 
void itemChecked (bool)
 Called internally when the legend has been checked.
 

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.

Constructor & Destructor Documentation

◆ QwtLegend()

QwtLegend::QwtLegend ( QWidget *  parent = nullptr)
explicit

Constructor for QwtLegend.

◆ ~QwtLegend()

QwtLegend::~QwtLegend ( )
virtual

Destructor .

Member Function Documentation

◆ checked

void QwtLegend::checked ( const QVariant &  itemInfo,
bool  on,
int  index 
)
signal

Signal emitted when the user clicks on a legend label in Checkable mode.

◆ clicked

void QwtLegend::clicked ( const QVariant &  itemInfo,
int  index 
)
signal

Signal emitted when the user clicks on a legend label in Clickable mode.

◆ contentsWidget() [1/2]

QWidget * QwtLegend::contentsWidget ( )

Return the contents widget.

◆ contentsWidget() [2/2]

const QWidget * QwtLegend::contentsWidget ( ) const

Return the contents widget (const version)

◆ createWidget()

QWidget * QwtLegend::createWidget ( const QwtLegendData legendData) const
protectedvirtual

Create a widget to be inserted into the legend.

◆ defaultItemMode()

QwtLegendData::Mode QwtLegend::defaultItemMode ( ) const

Return the default item mode.

◆ eventFilter()

bool QwtLegend::eventFilter ( QObject *  object,
QEvent *  event 
)
overridevirtual

Handle QEvent::ChildRemoved and QEvent::LayoutRequest events.

◆ heightForWidth()

int QwtLegend::heightForWidth ( int  width) const
overridevirtual

Return the preferred height for a given width.

◆ horizontalScrollBar()

QScrollBar * QwtLegend::horizontalScrollBar ( ) const

Return the horizontal scrollbar.

◆ isEmpty()

bool QwtLegend::isEmpty ( ) const
overridevirtual

Check if the legend is empty.

Implements QwtAbstractLegend.

◆ itemChecked

void QwtLegend::itemChecked ( bool  on)
protectedslot

Called internally when the legend has been checked.

◆ itemClicked

void QwtLegend::itemClicked ( )
protectedslot

Called internally when the legend has been clicked on.

◆ itemInfo()

QVariant QwtLegend::itemInfo ( const QWidget *  widget) const

Find the item that is associated to a widget.

◆ legendWidget()

QWidget * QwtLegend::legendWidget ( const QVariant &  itemInfo) const

Return first widget in the list of widgets associated to an item.

◆ legendWidgets()

QList< QWidget * > QwtLegend::legendWidgets ( const QVariant &  itemInfo) const

Return list of widgets associated to an item.

◆ maxColumns()

uint QwtLegend::maxColumns ( ) const

Return the maximum number of entries in a row.

◆ renderItem()

void QwtLegend::renderItem ( QPainter *  painter,
const QWidget *  widget,
const QRectF &  rect,
bool  fillBackground 
) const
virtual

Render a legend entry into a given rectangle.

◆ renderLegend()

void QwtLegend::renderLegend ( QPainter *  painter,
const QRectF &  rect,
bool  fillBackground 
) const
overridevirtual

Render the legend into a given rectangle.

Implements QwtAbstractLegend.

◆ scrollExtent()

int QwtLegend::scrollExtent ( Qt::Orientation  orientation) const
overridevirtual

Return the extent that is needed for the scrollbars.

Reimplemented from QwtAbstractLegend.

◆ setDefaultItemMode()

void QwtLegend::setDefaultItemMode ( QwtLegendData::Mode  mode)

Set the default mode for legend labels.

◆ setMaxColumns()

void QwtLegend::setMaxColumns ( uint  numColums)

Set the maximum number of entries in a row.

◆ sizeHint()

QSize QwtLegend::sizeHint ( ) const
overridevirtual

Return a size hint.

◆ updateLegend

void QwtLegend::updateLegend ( const QVariant &  itemInfo,
const QList< QwtLegendData > &  legendData 
)
overridevirtualslot

Update the entries for an item.

◆ updateWidget()

void QwtLegend::updateWidget ( QWidget *  widget,
const QwtLegendData legendData 
)
protectedvirtual

Update the widget.

◆ verticalScrollBar()

QScrollBar * QwtLegend::verticalScrollBar ( ) const

Return the vertical scrollbar.


The documentation for this class was generated from the following files: