Qwt User's Guide  6.2.0
qwt_legend_label.h
1 /******************************************************************************
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_text_label.h"
15 #include "qwt_legend_data.h"
16 
17 class QwtText;
18 
22 class QWT_EXPORT QwtLegendLabel : public QwtTextLabel
23 {
24  Q_OBJECT
25  public:
26  explicit QwtLegendLabel( QWidget* parent = 0 );
27  virtual ~QwtLegendLabel();
28 
29  void setData( const QwtLegendData& );
30  const QwtLegendData& data() const;
31 
32  void setItemMode( QwtLegendData::Mode );
33  QwtLegendData::Mode itemMode() const;
34 
35  void setSpacing( int spacing );
36  int spacing() const;
37 
38  virtual void setText( const QwtText& ) QWT_OVERRIDE;
39 
40  void setIcon( const QPixmap& );
41  QPixmap icon() const;
42 
43  virtual QSize sizeHint() const QWT_OVERRIDE;
44 
45  bool isChecked() const;
46 
47  public Q_SLOTS:
48  void setChecked( bool on );
49 
50  Q_SIGNALS:
52  void clicked();
53 
55  void pressed();
56 
58  void released();
59 
61  void checked( bool );
62 
63  protected:
64  void setDown( bool );
65  bool isDown() const;
66 
67  virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
68  virtual void mousePressEvent( QMouseEvent* ) QWT_OVERRIDE;
69  virtual void mouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
70  virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
71  virtual void keyReleaseEvent( QKeyEvent* ) QWT_OVERRIDE;
72 
73  private:
74  class PrivateData;
75  PrivateData* m_data;
76 };
77 
78 #endif
Attributes of an entry on a legend.
Mode
Mode defining how a legend entry interacts.
A widget representing something on a QwtLegend.
void checked(bool)
Signal, when the legend item has been toggled.
void released()
Signal, when the legend item has been released.
void clicked()
Signal, when the legend item has been clicked.
void pressed()
Signal, when the legend item has been pressed.
A class representing a text.
Definition: qwt_text.h:52
A Widget which displays a QwtText.
virtual QSize sizeHint() const override
Return a size hint.
void setText(const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)
virtual void paintEvent(QPaintEvent *) override