QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
qvselector.h
1 /* QVisu (c) 2015 Maximilian Gauger mgauger@kalassi.de
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12 
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef QVSELECTOR_H
18 #define QVSELECTOR_H
19 
20 #include <QLabel>
21 #include "../qvelement.h"
22 #include "../qviconwidget.h"
23 #include "../qvsvgwidget.h"
24 
26 public:
27  QString item;
28  QString label;
29  QString unit;
30  int precision;
31  double value;
32  QWidget *widget;
33 };
34 
35 class QVSelector : public QVElement
36 {
37  Q_OBJECT
38 public:
39  explicit QVSelector(QDomElement xml_desc,QString container,QWidget *parent = 0);
40 
41 public slots:
42  void onContainerChanged(QString);
43  void onValueChanged(QString,QString);
44 
45 protected:
46  void resizeEvent(QResizeEvent*);
47  void mousePressEvent(QMouseEvent*);
48 
49 signals:
50  void containerChanged(QString);
51 
52 protected slots:
53  void onSvgPressed();
54 
55 private:
56  QByteArray svg_icon;
57  QVIconWidget *w_icon;
58  QLabel *w_text;
59  QList<display_value_t*> disp_contents;
60 
61  QString target;
62 
63 };
64 
65 #endif // QVSELECTOR_H
Definition: qvselector.h:25
Definition: qviconwidget.h:26
Definition: qvelement.h:34
Definition: qvselector.h:35
void resizeEvent(QResizeEvent *)
Definition: qvselector.cpp:147
QString container
Definition: qvelement.h:73