Qwt User's Guide 6.1.0

- Main Page
- Related Pages
- Classes

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
qwt_legend_label.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_LABEL_H
11 #define QWT_LEGEND_LABEL_H
12
13 #include "qwt_global.h"
14 #include "qwt_legend_data.h"
15 #include "qwt_text.h"
16 #include "qwt_text_label.h"
17 #include <qpixmap.h>
18
19 class QwtLegendData;
20
24 class QWT_EXPORT QwtLegendLabel: public QwtTextLabel
25 {
26 Q_OBJECT
27 public:
28 explicit QwtLegendLabel( QWidget *parent = 0 );
29 virtual ~QwtLegendLabel();
30
31 void setData( const QwtLegendData & );
32 const QwtLegendData &data() const;
33
34 void setItemMode( QwtLegendData::Mode );
35 QwtLegendData::Mode itemMode() const;
36
37 void setSpacing( int spacing );
38 int spacing() const;
39
40 virtual void setText( const QwtText & );
41
42 void setIcon( const QPixmap & );
43 QPixmap icon() const;
44
45 virtual QSize sizeHint() const;
46
47 bool isChecked() const;
48
49 public Q_SLOTS:
50 void setChecked( bool on );
51
52 Q_SIGNALS:
54 void clicked();
55
57 void pressed();
58
60 void released();
61
63 void checked( bool );
64
65 protected:
66 void setDown( bool );
67 bool isDown() const;
68
69 virtual void paintEvent( QPaintEvent * );
70 virtual void mousePressEvent( QMouseEvent * );
71 virtual void mouseReleaseEvent( QMouseEvent * );
72 virtual void keyPressEvent( QKeyEvent * );
73 virtual void keyReleaseEvent( QKeyEvent * );
74
75 private:
76 class PrivateData;
77 PrivateData *d_data;
78 };
79
80 #endif