qwt_legend.h
Go to the documentation of this file.
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 "qwt_legend_data.h"
16 
17 #include <qvariant.h>
18 
19 class QScrollBar;
20 
32 {
33  Q_OBJECT
34 
35 public:
36  explicit QwtLegend( QWidget *parent = NULL );
37  virtual ~QwtLegend();
38 
39  void setMaxColumns( uint numColums );
40  uint maxColumns() const;
41 
42  void setDefaultItemMode( QwtLegendData::Mode );
43  QwtLegendData::Mode defaultItemMode() const;
44 
45  QWidget *contentsWidget();
46  const QWidget *contentsWidget() const;
47 
48  QWidget *legendWidget( const QVariant & ) const;
49  QList<QWidget *> legendWidgets( const QVariant & ) const;
50 
51  QVariant itemInfo( const QWidget * ) const;
52 
53  virtual bool eventFilter( QObject *, QEvent * ) QWT_OVERRIDE;
54 
55  virtual QSize sizeHint() const QWT_OVERRIDE;
56  virtual int heightForWidth( int w ) const QWT_OVERRIDE;
57 
58  QScrollBar *horizontalScrollBar() const;
59  QScrollBar *verticalScrollBar() const;
60 
61  virtual void renderLegend( QPainter *,
62  const QRectF &, bool fillBackground ) const QWT_OVERRIDE;
63 
64  virtual void renderItem( QPainter *,
65  const QWidget *, const QRectF &, bool fillBackground ) const;
66 
67  virtual bool isEmpty() const QWT_OVERRIDE;
68  virtual int scrollExtent( Qt::Orientation ) const QWT_OVERRIDE;
69 
70 Q_SIGNALS:
83  void clicked( const QVariant &itemInfo, int index );
84 
98  void checked( const QVariant &itemInfo, bool on, int index );
99 
100 public Q_SLOTS:
101  virtual void updateLegend( const QVariant &,
103 
104 protected Q_SLOTS:
105  void itemClicked();
106  void itemChecked( bool );
107 
108 protected:
109  virtual QWidget *createWidget( const QwtLegendData & ) const;
110  virtual void updateWidget( QWidget *, const QwtLegendData & );
111 
112 private:
113  void updateTabOrder();
114 
115  class PrivateData;
117 };
118 
119 #endif
#define QWT_EXPORT
Definition: qwt_global.h:38
virtual bool isEmpty() const =0
virtual void updateLegend(const QVariant &itemInfo, const QList< QwtLegendData > &data)=0
Update the entries for a plot item.
PrivateData * d_data
Definition: qwt_legend.h:115
virtual void renderLegend(QPainter *painter, const QRectF &rect, bool fillBackground) const =0
Abstract base class for legend widgets.
The legend widget.
Definition: qwt_legend.h:31
Mode
Mode defining how a legend entry interacts.
virtual int scrollExtent(Qt::Orientation) const
Attributes of an entry on a legend.
#define QWT_OVERRIDE
Definition: qwt_global.h:53


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10