qwt_legend.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_LEGEND_H
#define QWT_LEGEND_H
#include "qwt_global.h"
#include "qwt_abstract_legend.h"
#include "qwt_legend_data.h"
#include <qvariant.h>
class QScrollBar;
class QWT_EXPORT QwtLegend : public QwtAbstractLegend
{
Q_OBJECT
public:
explicit QwtLegend( QWidget* parent = NULL );
virtual ~QwtLegend();
void setMaxColumns( uint numColums );
uint maxColumns() const;
void setDefaultItemMode( QwtLegendData::Mode );
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* ) QWT_OVERRIDE;
virtual QSize sizeHint() const QWT_OVERRIDE;
virtual int heightForWidth( int w ) const QWT_OVERRIDE;
QScrollBar* horizontalScrollBar() const;
QScrollBar* verticalScrollBar() const;
virtual void renderLegend( QPainter*,
const QRectF&, bool fillBackground ) const QWT_OVERRIDE;
virtual void renderItem( QPainter*,
const QWidget*, const QRectF&, bool fillBackground ) const;
virtual bool isEmpty() const QWT_OVERRIDE;
virtual int scrollExtent( Qt::Orientation ) const QWT_OVERRIDE;
Q_SIGNALS:
void clicked( const QVariant& itemInfo, int index );
void checked( const QVariant& itemInfo, bool on, int index );
public Q_SLOTS:
virtual void updateLegend( const QVariant&,
const QList< QwtLegendData >& ) QWT_OVERRIDE;
protected Q_SLOTS:
void itemClicked();
void itemChecked( bool );
protected:
virtual QWidget* createWidget( const QwtLegendData& ) const;
virtual void updateWidget( QWidget*, const QwtLegendData& );
private:
void updateTabOrder();
class PrivateData;
PrivateData* m_data;
};
#endif
QList
Definition: qwt_abstract_legend.h:17
QwtAbstractLegend
Abstract base class for legend widgets.
Definition: qwt_abstract_legend.h:35
QwtAbstractLegend::renderLegend
virtual void renderLegend(QPainter *painter, const QRectF &rect, bool fillBackground) const =0
QwtAbstractLegend::scrollExtent
virtual int scrollExtent(Qt::Orientation) const
Definition: qwt_abstract_legend.cpp:35
QwtAbstractLegend::isEmpty
virtual bool isEmpty() const =0
QwtAbstractLegend::updateLegend
virtual void updateLegend(const QVariant &itemInfo, const QList< QwtLegendData > &data)=0
Update the entries for a plot item.
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:37
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts.
Definition: qwt_legend_data.h:41
QwtLegend
The legend widget.
Definition: qwt_legend.h:32
QwtLegend::clicked
void clicked(const QVariant &itemInfo, int index)
QwtLegend::checked
void checked(const QVariant &itemInfo, bool on, int index)