Data_deduplication_service
Service that will use hashes to deduplicate files
qledindicator.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2010 by Tn *
3  * thenobody@poczta.fm *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU Library General Public License as *
7  * published by the Free Software Foundation; either version 3 of the *
8  * License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public *
16  * License along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
21 #ifndef QLEDINDICATOR_H
22 #define QLEDINDICATOR_H
23 
24 #include <QAbstractButton>
25 #include <QResizeEvent>
26 #include <QColor>
27 #include <QDebug>
31 class QLedIndicator : public QAbstractButton {
32  Q_PROPERTY(QColor onColor1 WRITE setOnColor1 READ getOnColor1);
33  Q_PROPERTY(QColor onColor2 WRITE setOnColor2 READ getOnColor2);
34  Q_PROPERTY(QColor offColor1 WRITE setOffColor1 READ getOffColor1);
35  Q_PROPERTY(QColor offColor2 WRITE setOffColor2 READ getOffColor2);
36 Q_OBJECT
37 public:
38  QLedIndicator(QWidget *parent);
39 
40  void setOnColor1(QColor c) { onColor1 = c; }
41 
42  void setOffColor1(QColor c) { offColor1 = c; }
43 
44  void setOnColor2(QColor c) { onColor2 = c; }
45 
46  void setOffColor2(QColor c) { offColor2 = c; }
47 
48  QColor getOnColor1(void) { return onColor1; }
49 
50  QColor getOffColor1(void) { return offColor1; }
51 
52  QColor getOnColor2(void) { return onColor2; }
53 
54  QColor getOffColor2(void) { return offColor2; }
55 
56 protected:
57  virtual void paintEvent(QPaintEvent *event);
58 
59  virtual void resizeEvent(QResizeEvent *event);
60 
61 private:
62  static const qreal scaledSize; /* init in cpp */
63  QColor onColor1, offColor1;
64  QColor onColor2, offColor2;
65  QPixmap ledBuffer;
66 };
67 
68 #endif // QLEDINDICATOR_H
QLedIndicator class from https://store.kde.org/p/1132137/.
Definition: qledindicator.h:31
void setOffColor1(QColor c)
Definition: qledindicator.h:42
QColor onColor2
Definition: qledindicator.h:32
QColor offColor1
Definition: qledindicator.h:33
QColor getOffColor2(void)
Definition: qledindicator.h:54
void setOnColor1(QColor c)
Definition: qledindicator.h:40
void setOffColor2(QColor c)
Definition: qledindicator.h:46
void setOnColor2(QColor c)
Definition: qledindicator.h:44
QColor getOnColor2(void)
Definition: qledindicator.h:52
QLedIndicator(QWidget *parent)
Definition: qledindicator.cpp:27
QColor offColor2
Definition: qledindicator.h:34
virtual void paintEvent(QPaintEvent *event)
Definition: qledindicator.cpp:40
QColor getOffColor1(void)
Definition: qledindicator.h:50
virtual void resizeEvent(QResizeEvent *event)
Definition: qledindicator.cpp:36
QColor getOnColor1(void)
Definition: qledindicator.h:48
QColor onColor1
Definition: qledindicator.h:32