kwave  18.07.70
MultiStateWidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  MultiStateWidget.h - provides methods of multistateWidget a Class that
3  switches the image it, displays on clicking, used
4  for the channel enable/disable lamps...
5  -------------------
6  begin : Sun Jun 04 2000
7  copyright : (C) 2000 by Martin Wilz
8  email : martin@wilz.de
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 #ifndef MULTI_STATE_WIDGET_H
20 #define MULTI_STATE_WIDGET_H
21 
22 #include "config.h"
23 
24 #include <QtGlobal>
25 #include <QPixmap>
26 #include <QVector>
27 #include <QWidget>
28 
29 class QPaintEvent;
30 class QMouseEvent;
31 class QString;
32 
33 namespace Kwave
34 {
35 
36  class Q_DECL_EXPORT MultiStateWidget: public QWidget
37  {
38  Q_OBJECT
39 
40  public:
41 
47  MultiStateWidget(QWidget *parent, int id);
48 
50  virtual ~MultiStateWidget() Q_DECL_OVERRIDE;
51 
57  void setID(int id);
58 
70  void addPixmap(const QString &filename);
71 
72  public slots:
73 
79  void setState(int newstate);
80 
87  void switchState(bool on);
88 
90  void nextState();
91 
92  signals:
93 
98  void clicked(int id);
99 
100  private:
101 
103  virtual void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
104 
106  virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
107 
108  private:
109 
112 
115 
117  QVector<QPixmap> m_pixmaps;
118  };
119 }
120 
121 #endif // _MULTI_STATE_WIDGET_H_
122 
123 //***************************************************************************
124 //***************************************************************************
Definition: App.h:33
QVector< QPixmap > m_pixmaps