qwt_legend_label.h
Go to the documentation of this file.
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 
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;
78 };
79 
80 #endif
A widget representing something on a QwtLegend.
virtual QSize sizeHint() const
Return a size hint.
A Widget which displays a QwtText.
#define QWT_EXPORT
Definition: qwt_global.h:38
A class representing a text.
Definition: qwt_text.h:51
virtual void paintEvent(QPaintEvent *e)
empty_struct data[sizeof(T)/sizeof(empty_struct)]
PrivateData * d_data
Mode
Mode defining how a legend entry interacts.
Attributes of an entry on a legend.
void setText(const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17