~feng-kylin/youker-assistant/youker-assistant

« back to all changes in this revision

Viewing changes to component/kylinswitcher.h

  • Committer: kobe
  • Date: 2015-02-13 07:37:10 UTC
  • Revision ID: xiangli@ubuntukylin.com-20150213073710-0jyp02ilyi5njj10
Qt Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef KYLINSWITCHER_H
 
2
#define KYLINSWITCHER_H
 
3
 
 
4
#include <QWidget>
 
5
#include <QPainter>
 
6
#include <QMouseEvent>
 
7
 
 
8
class KylinSwitcher : public QWidget
 
9
{
 
10
    Q_OBJECT
 
11
public:
 
12
    explicit KylinSwitcher(QWidget *parent = 0);
 
13
    bool switchedOn;
 
14
//    void setSwitchStatus(bool flag) {switchedOn = flag;}
 
15
 
 
16
protected:
 
17
    void mousePressEvent(QMouseEvent *event);
 
18
    void mouseReleaseEvent(QMouseEvent *event);
 
19
    void paintEvent(QPaintEvent *);
 
20
//    void enterEvent(QEvent *);
 
21
 
 
22
signals:
 
23
    void clicked();
 
24
 
 
25
public slots:
 
26
 
 
27
private:
 
28
    QPixmap pixmap_on;
 
29
    QPixmap pixmap_off;
 
30
    bool mouse_press;
 
31
};
 
32
 
 
33
#endif // KYLINSWITCHER_H