ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mperfwidget.h
Go to the documentation of this file.
1 #ifndef MPERFWIDGET_H
2 #define MPERFWIDGET_H
3 
4 #include <QWidget>
5 #include <QSlider>
6 #include <QSpinBox>
7 #include <QCheckBox>
8 #include <QRadioButton>
9 #include <QSignalMapper>
10 #include "kbperf.h"
11 #include "kbprofile.h"
12 #include "colorbutton.h"
13 
14 namespace Ui {
15 class MPerfWidget;
16 }
17 
18 class MPerfWidget : public QWidget
19 {
20  Q_OBJECT
21 
22 public:
23  explicit MPerfWidget(QWidget *parent = 0);
24  ~MPerfWidget();
25 
26  void setPerf(KbPerf* newPerf, KbProfile* newProfile);
27 
28  static const int DPI_COUNT = KbPerf::DPI_COUNT;
30 
31 private:
33 
36 
37  struct DpiUi {
39  QSlider* xSlider, *ySlider;
40  QSpinBox* xBox, *yBox;
41  QCheckBox* enableCheck;
42  };
44  bool _xyLink;
45  bool colorLink;
46 
47  QSignalMapper buttonMapper1, buttonMapper2;
48  QSignalMapper sliderXMapper, sliderYMapper;
49  QSignalMapper boxXMapper, boxYMapper;
50  QSignalMapper enableMapper;
51 
52  // Hack: prevent recursive slot calls
53  bool isSetting;
54 
55 private slots:
56  void colorClicked(int index);
57  void colorChanged(int index);
58  void sliderXMoved(int index);
59  void sliderYMoved(int index);
60  void boxXChanged(int index);
61  void boxYChanged(int index);
62  void enableChanged(int index);
63 
64  void on_xyBox_clicked(bool checked);
65  void on_indicBox_clicked(bool checked);
66  void on_aSnapBox_clicked(bool checked);
67  void on_lHeightBox_activated(int index);
68  void on_copyButton_clicked();
69  void on_spinBox_valueChanged(int arg1);
70 };
71 
72 #endif // MPERFWIDGET_H
void on_lHeightBox_activated(int index)
void sliderXMoved(int index)
MPerfWidget(QWidget *parent=0)
Definition: mperfwidget.cpp:8
void on_xyBox_clicked(bool checked)
bool _xyLink
Definition: mperfwidget.h:44
Ui::MPerfWidget * ui
Definition: mperfwidget.h:32
static const int DPI_COUNT
Definition: mperfwidget.h:28
QCheckBox * enableCheck
Definition: mperfwidget.h:41
static const int DPI_MIN
Definition: kbperf.h:47
QSignalMapper sliderXMapper
Definition: mperfwidget.h:48
static const int DPI_MAX
Definition: kbperf.h:47
QSpinBox * xBox
Definition: mperfwidget.h:40
ColorButton * indicator
Definition: mperfwidget.h:38
QSignalMapper boxYMapper
Definition: mperfwidget.h:49
QSignalMapper buttonMapper2
Definition: mperfwidget.h:47
void enableChanged(int index)
void colorClicked(int index)
Definition: mperfwidget.cpp:81
bool isSetting
Definition: mperfwidget.h:53
QSlider * ySlider
Definition: mperfwidget.h:39
KbProfile * profile
Definition: mperfwidget.h:35
QSignalMapper enableMapper
Definition: mperfwidget.h:50
Definition: kbperf.h:15
void on_indicBox_clicked(bool checked)
void colorChanged(int index)
Definition: mperfwidget.cpp:86
void on_spinBox_valueChanged(int arg1)
static const int DPI_COUNT
Definition: kbperf.h:46
QSignalMapper sliderYMapper
Definition: mperfwidget.h:48
void boxYChanged(int index)
bool colorLink
Definition: mperfwidget.h:45
void on_aSnapBox_clicked(bool checked)
QSpinBox * yBox
Definition: mperfwidget.h:40
KbPerf * perf
Definition: mperfwidget.h:34
static const int DPI_MIN
Definition: mperfwidget.h:29
QSignalMapper boxXMapper
Definition: mperfwidget.h:49
static const int DPI_MAX
Definition: mperfwidget.h:29
QSlider * xSlider
Definition: mperfwidget.h:39
QSignalMapper buttonMapper1
Definition: mperfwidget.h:47
void on_copyButton_clicked()
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43
void setPerf(KbPerf *newPerf, KbProfile *newProfile)
Definition: mperfwidget.cpp:60
void sliderYMoved(int index)
void boxXChanged(int index)