00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_LEGEND_ITEM_H
00011 #define QWT_LEGEND_ITEM_H
00012
00013 #include "qwt_global.h"
00014 #include "qwt_legend.h"
00015 #include "qwt_text.h"
00016 #include "qwt_text_label.h"
00017 #include <qpixmap.h>
00018
00022 class QWT_EXPORT QwtLegendItem: public QwtTextLabel
00023 {
00024 Q_OBJECT
00025 public:
00026 explicit QwtLegendItem( QWidget *parent = 0 );
00027 virtual ~QwtLegendItem();
00028
00029 void setItemMode( QwtLegend::LegendItemMode );
00030 QwtLegend::LegendItemMode itemMode() const;
00031
00032 void setSpacing( int spacing );
00033 int spacing() const;
00034
00035 virtual void setText( const QwtText & );
00036
00037 void setIdentifier( const QPixmap & );
00038 QPixmap identifier() const;
00039
00040 void setIdentifierSize( const QSize & );
00041 QSize identifierSize() const;
00042
00043 virtual QSize sizeHint() const;
00044
00045 bool isChecked() const;
00046
00047 public Q_SLOTS:
00048 void setChecked( bool on );
00049
00050 Q_SIGNALS:
00052 void clicked();
00053
00055 void pressed();
00056
00058 void released();
00059
00061 void checked( bool );
00062
00063 protected:
00064 void setDown( bool );
00065 bool isDown() const;
00066
00067 virtual void paintEvent( QPaintEvent * );
00068 virtual void mousePressEvent( QMouseEvent * );
00069 virtual void mouseReleaseEvent( QMouseEvent * );
00070 virtual void keyPressEvent( QKeyEvent * );
00071 virtual void keyReleaseEvent( QKeyEvent * );
00072
00073 private:
00074 class PrivateData;
00075 PrivateData *d_data;
00076 };
00077
00078 #endif