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
00019 class QWT_EXPORT QwtLegendItem: public QwtTextLabel
00020 {
00021 Q_OBJECT
00022 public:
00023 explicit QwtLegendItem(QWidget *parent = 0);
00024 virtual ~QwtLegendItem();
00025
00026 void setItemMode(QwtLegend::LegendItemMode);
00027 QwtLegend::LegendItemMode itemMode() const;
00028
00029 void setSpacing(int spacing);
00030 int spacing() const;
00031
00032 virtual void setText(const QwtText &);
00033
00034 void setIdentifier(const QPixmap &);
00035 QPixmap identifier() const;
00036
00037 void setIdentifierWidth(int width);
00038 int identifierWidth() const;
00039
00040 virtual QSize sizeHint() const;
00041
00042 bool isChecked() const;
00043
00044 public Q_SLOTS:
00045 void setChecked(bool on);
00046
00047 Q_SIGNALS:
00049 void clicked();
00050
00052 void pressed();
00053
00055 void released();
00056
00058 void checked(bool);
00059
00060 protected:
00061 void setDown(bool);
00062 bool isDown() const;
00063
00064 virtual void paintEvent(QPaintEvent *);
00065 virtual void mousePressEvent(QMouseEvent *);
00066 virtual void mouseReleaseEvent(QMouseEvent *);
00067 virtual void keyPressEvent(QKeyEvent *);
00068 virtual void keyReleaseEvent(QKeyEvent *);
00069
00070 private:
00071 class PrivateData;
00072 PrivateData *d_data;
00073 };
00074
00075 #endif // QWT_LEGEND_ITEM_H