Qwt User's Guide 6.0.2

- Main Page
- Related Pages
- Classes

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 <qframe.h>
15 #include <qlist.h>
16
17 class QScrollBar;
18 class QwtLegendItemManager;
19
30 class QWT_EXPORT QwtLegend : public QFrame
31 {
32 Q_OBJECT
33
34 public:
45 enum LegendItemMode
46 {
48 ReadOnlyItem,
49
51 ClickableItem,
52
54 CheckableItem
55 };
56
57 explicit QwtLegend( QWidget *parent = NULL );
58 virtual ~QwtLegend();
59
60 void setItemMode( LegendItemMode );
61 LegendItemMode itemMode() const;
62
63 QWidget *contentsWidget();
64 const QWidget *contentsWidget() const;
65
66 void insert( const QwtLegendItemManager *, QWidget * );
67 void remove( const QwtLegendItemManager * );
68
69 QWidget *find( const QwtLegendItemManager * ) const;
70 QwtLegendItemManager *find( const QWidget * ) const;
71
72 virtual QList<QWidget *> legendItems() const;
73
74 void clear();
75
76 bool isEmpty() const;
77 uint itemCount() const;
78
79 virtual bool eventFilter( QObject *, QEvent * );
80
81 virtual QSize sizeHint() const;
82 virtual int heightForWidth( int w ) const;
83
84 QScrollBar *horizontalScrollBar() const;
85 QScrollBar *verticalScrollBar() const;
86
87 protected:
88 virtual void layoutContents();
89
90 private:
91 class PrivateData;
92 PrivateData *d_data;
93 };
94
95 #endif