Qwt User's Guide 6.1.4

qwt_legend.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_LEGEND_H
11 #define QWT_LEGEND_H
12
13 #include "qwt_global.h"
14 #include "qwt_abstract_legend.h"
15 #include <qvariant.h>
16
17 class QScrollBar;
18
29 class QWT_EXPORT QwtLegend : public QwtAbstractLegend
30 {
31 Q_OBJECT
32
33 public:
34 explicit QwtLegend( QWidget *parent = NULL );
35 virtual ~QwtLegend();
36
37 void setMaxColumns( uint numColums );
38 uint maxColumns() const;
39
40 void setDefaultItemMode( QwtLegendData::Mode );
41 QwtLegendData::Mode defaultItemMode() const;
42
43 QWidget *contentsWidget();
44 const QWidget *contentsWidget() const;
45
46 QWidget *legendWidget( const QVariant & ) const;
47 QList<QWidget *> legendWidgets( const QVariant & ) const;
48
49 QVariant itemInfo( const QWidget * ) const;
50
51 virtual bool eventFilter( QObject *, QEvent * );
52
53 virtual QSize sizeHint() const;
54 virtual int heightForWidth( int width ) const;
55
56 QScrollBar *horizontalScrollBar() const;
57 QScrollBar *verticalScrollBar() const;
58
59 virtual void renderLegend( QPainter *,
60 const QRectF &, bool fillBackground ) const;
61
62 virtual void renderItem( QPainter *,
63 const QWidget *, const QRectF &, bool fillBackground ) const;
64
65 virtual bool isEmpty() const;
66 virtual int scrollExtent( Qt::Orientation ) const;
67
68 Q_SIGNALS:
81 void clicked( const QVariant &itemInfo, int index );
82
96 void checked( const QVariant &itemInfo, bool on, int index );
97
98 public Q_SLOTS:
99 virtual void updateLegend( const QVariant &,
100 const QList<QwtLegendData> & );
101
102 protected Q_SLOTS:
103 void itemClicked();
104 void itemChecked( bool );
105
106 protected:
107 virtual QWidget *createWidget( const QwtLegendData & ) const;
108 virtual void updateWidget( QWidget *widget, const QwtLegendData & );
109
110 private:
111 void updateTabOrder();
112
113 class PrivateData;
114 PrivateData *d_data;
115 };
116
117 #endif
QwtAbstractLegend
Abstract base class for legend widgets.
Definition: qwt_abstract_legend.h:34
QwtLegend
The legend widget.
Definition: qwt_legend.h:29
QwtAbstractLegend::scrollExtent
virtual int scrollExtent(Qt::Orientation) const
Definition: qwt_abstract_legend.cpp:34
QwtAbstractLegend::renderLegend
virtual void renderLegend(QPainter *painter, const QRectF &rect, bool fillBackground) const =0
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:35
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts.
Definition: qwt_legend_data.h:39
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.