Qwt User's Guide: qwt_legend.h Source File

Qwt User's Guide 5.2.3

- 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 // vim: expandtab
11
12 #ifndef QWT_LEGEND_H
13 #define QWT_LEGEND_H
14
15 #include <qframe.h>
16 #include "qwt_global.h"
17 #if QT_VERSION < 0x040000
18 #include <qvaluelist.h>
19 #else
20 #include <qlist.h>
21 #endif
22
23 class QScrollBar;
24 class QwtLegendItemManager;
25
36 class QWT_EXPORT QwtLegend : public QFrame
37 {
38 Q_OBJECT
39
40 public:
62 enum LegendDisplayPolicy
63 {
64 NoIdentifier = 0,
65 FixedIdentifier = 1,
66 AutoIdentifier = 2
67 };
68
87 enum LegendItemMode
88 {
89 ReadOnlyItem,
90 ClickableItem,
91 CheckableItem
92 };
93
94 explicit QwtLegend(QWidget *parent = NULL);
95 virtual ~QwtLegend();
96
97 void setDisplayPolicy(LegendDisplayPolicy policy, int mode);
98 LegendDisplayPolicy displayPolicy() const;
99
100 void setItemMode(LegendItemMode);
101 LegendItemMode itemMode() const;
102
103 int identifierMode() const;
104
105 QWidget *contentsWidget();
106 const QWidget *contentsWidget() const;
107
108 void insert(const QwtLegendItemManager *, QWidget *);
109 void remove(const QwtLegendItemManager *);
110
111 QWidget *find(const QwtLegendItemManager *) const;
112 QwtLegendItemManager *find(const QWidget *) const;
113
114 #if QT_VERSION < 0x040000
115 virtual QValueList<QWidget *> legendItems() const;
116 #else
117 virtual QList<QWidget *> legendItems() const;
118 #endif
119
120 void clear();
121
122 bool isEmpty() const;
123 uint itemCount() const;
124
125 virtual bool eventFilter(QObject *, QEvent *);
126
127 virtual QSize sizeHint() const;
128 virtual int heightForWidth(int w) const;
129
130 QScrollBar *horizontalScrollBar() const;
131 QScrollBar *verticalScrollBar() const;
132
133 protected:
134 virtual void resizeEvent(QResizeEvent *);
135 virtual void layoutContents();
136
137 private:
138 class PrivateData;
139 PrivateData *d_data;
140 };
141
142 #endif // QWT_LEGEND_H