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 Class Reference

#include <src/ckb/mperfwidget.h>

+ Inheritance diagram for MPerfWidget:
+ Collaboration diagram for MPerfWidget:

Data Structures

struct  DpiUi
 

Public Member Functions

 MPerfWidget (QWidget *parent=0)
 
 ~MPerfWidget ()
 
void setPerf (KbPerf *newPerf, KbProfile *newProfile)
 

Static Public Attributes

static const int DPI_COUNT = KbPerf::DPI_COUNT
 
static const int DPI_MIN = KbPerf::DPI_MIN
 
static const int DPI_MAX = KbPerf::DPI_MAX
 

Private Slots

void colorClicked (int index)
 
void colorChanged (int index)
 
void sliderXMoved (int index)
 
void sliderYMoved (int index)
 
void boxXChanged (int index)
 
void boxYChanged (int index)
 
void enableChanged (int index)
 
void on_xyBox_clicked (bool checked)
 
void on_indicBox_clicked (bool checked)
 
void on_aSnapBox_clicked (bool checked)
 
void on_lHeightBox_activated (int index)
 
void on_copyButton_clicked ()
 
void on_spinBox_valueChanged (int arg1)
 

Private Attributes

Ui::MPerfWidgetui
 
KbPerfperf
 
KbProfileprofile
 
DpiUi stages [DPI_COUNT]
 
bool _xyLink
 
bool colorLink
 
QSignalMapper buttonMapper1
 
QSignalMapper buttonMapper2
 
QSignalMapper sliderXMapper
 
QSignalMapper sliderYMapper
 
QSignalMapper boxXMapper
 
QSignalMapper boxYMapper
 
QSignalMapper enableMapper
 
bool isSetting
 

Detailed Description

Definition at line 18 of file mperfwidget.h.


Data Structure Documentation

struct MPerfWidget::DpiUi

Definition at line 37 of file mperfwidget.h.

+ Collaboration diagram for MPerfWidget::DpiUi:
Data Fields
QCheckBox * enableCheck
ColorButton * indicator
QSpinBox * xBox
QSlider * xSlider
QSpinBox * yBox
QSlider * ySlider

Constructor & Destructor Documentation

MPerfWidget::MPerfWidget ( QWidget parent = 0)
explicit

Definition at line 8 of file mperfwidget.cpp.

References _xyLink, ColorButton::allowAlpha(), ColorButton::bigIcons(), boxXChanged(), boxXMapper, boxYChanged(), boxYMapper, buttonMapper1, buttonMapper2, colorChanged(), colorClicked(), DPI_COUNT, Ui_MPerfWidget::eBox1, Ui_MPerfWidget::eBox2, Ui_MPerfWidget::eBox3, Ui_MPerfWidget::eBox4, Ui_MPerfWidget::eBox5, enableChanged(), MPerfWidget::DpiUi::enableCheck, enableMapper, Ui_MPerfWidget::iButton0, Ui_MPerfWidget::iButton1, Ui_MPerfWidget::iButton2, Ui_MPerfWidget::iButton3, Ui_MPerfWidget::iButton4, Ui_MPerfWidget::iButton5, Ui_MPerfWidget::iButtonO, MPerfWidget::DpiUi::indicator, ColorButton::setLabel(), Ui_MPerfWidget::setupUi(), sliderXMapper, sliderXMoved(), sliderYMapper, sliderYMoved(), stages, ui, MPerfWidget::DpiUi::xBox, Ui_MPerfWidget::xBox0, Ui_MPerfWidget::xBox1, Ui_MPerfWidget::xBox2, Ui_MPerfWidget::xBox3, Ui_MPerfWidget::xBox4, Ui_MPerfWidget::xBox5, MPerfWidget::DpiUi::xSlider, Ui_MPerfWidget::xSlider0, Ui_MPerfWidget::xSlider1, Ui_MPerfWidget::xSlider2, Ui_MPerfWidget::xSlider3, Ui_MPerfWidget::xSlider4, Ui_MPerfWidget::xSlider5, Ui_MPerfWidget::xyBox, MPerfWidget::DpiUi::yBox, Ui_MPerfWidget::yBox0, Ui_MPerfWidget::yBox1, Ui_MPerfWidget::yBox2, Ui_MPerfWidget::yBox3, Ui_MPerfWidget::yBox4, Ui_MPerfWidget::yBox5, MPerfWidget::DpiUi::ySlider, Ui_MPerfWidget::ySlider0, Ui_MPerfWidget::ySlider1, Ui_MPerfWidget::ySlider2, Ui_MPerfWidget::ySlider3, Ui_MPerfWidget::ySlider4, and Ui_MPerfWidget::ySlider5.

8  :
9  QWidget(parent), ui(new Ui::MPerfWidget), perf(0), profile(0), _xyLink(!CkbSettings::get(xyLinkPath).toBool()), colorLink(false), isSetting(false) {
10  ui->setupUi(this);
11  ui->xyBox->setChecked(!_xyLink);
12  // Set up DPI stages
19  ui->iButtonO->setLabel(false);
20  ui->iButtonO->bigIcons(true);
21  ui->iButtonO->allowAlpha(true);
22  for(int i = 0; i < DPI_COUNT; i++){
23  stages[i].indicator->setLabel(false);
24  stages[i].indicator->bigIcons(true);
25  stages[i].indicator->allowAlpha(true);
26  // Map signals
27  connect(stages[i].indicator, SIGNAL(clicked(bool)), &buttonMapper1, SLOT(map()));
28  connect(stages[i].indicator, SIGNAL(colorChanged(QColor)), &buttonMapper2, SLOT(map()));
29  connect(stages[i].xSlider, SIGNAL(valueChanged(int)), &sliderXMapper, SLOT(map()));
30  connect(stages[i].ySlider, SIGNAL(valueChanged(int)), &sliderYMapper, SLOT(map()));
31  connect(stages[i].xBox, SIGNAL(valueChanged(int)), &boxXMapper, SLOT(map()));
32  connect(stages[i].yBox, SIGNAL(valueChanged(int)), &boxYMapper, SLOT(map()));
33  if(stages[i].enableCheck)
34  // Sniper has no enable
35  connect(stages[i].enableCheck, SIGNAL(stateChanged(int)), &enableMapper, SLOT(map()));
36  // Set names
37  buttonMapper1.setMapping(stages[i].indicator, i);
38  buttonMapper2.setMapping(stages[i].indicator, i);
39  sliderXMapper.setMapping(stages[i].xSlider, i);
40  sliderYMapper.setMapping(stages[i].ySlider, i);
41  boxXMapper.setMapping(stages[i].xBox, i);
42  boxYMapper.setMapping(stages[i].yBox, i);
43  if(stages[i].enableCheck)
44  enableMapper.setMapping(stages[i].enableCheck, i);
45  }
46  // Connect to slots
47  connect(&buttonMapper1, SIGNAL(mapped(int)), this, SLOT(colorClicked(int)));
48  connect(&buttonMapper2, SIGNAL(mapped(int)), this, SLOT(colorChanged(int)));
49  connect(&sliderXMapper, SIGNAL(mapped(int)), this, SLOT(sliderXMoved(int)));
50  connect(&sliderYMapper, SIGNAL(mapped(int)), this, SLOT(sliderYMoved(int)));
51  connect(&boxXMapper, SIGNAL(mapped(int)), this, SLOT(boxXChanged(int)));
52  connect(&boxYMapper, SIGNAL(mapped(int)), this, SLOT(boxYChanged(int)));
53  connect(&enableMapper, SIGNAL(mapped(int)), this, SLOT(enableChanged(int)));
54 }
void sliderXMoved(int index)
ColorButton * iButton5
ColorButton * iButton0
QSlider * xSlider3
ColorButton * iButtonO
QCheckBox * eBox3
QCheckBox * eBox1
bool _xyLink
Definition: mperfwidget.h:44
Ui::MPerfWidget * ui
Definition: mperfwidget.h:32
static const int DPI_COUNT
Definition: mperfwidget.h:28
QSpinBox * xBox5
QSlider * ySlider1
QSpinBox * yBox3
QSlider * ySlider4
QCheckBox * enableCheck
Definition: mperfwidget.h:41
QSpinBox * xBox1
QSignalMapper sliderXMapper
Definition: mperfwidget.h:48
void setupUi(QWidget *MPerfWidget)
QSpinBox * xBox2
static QVariant get(const QString &key, const QVariant &defaultValue=QVariant())
QSpinBox * xBox3
QSpinBox * xBox
Definition: mperfwidget.h:40
QCheckBox * eBox4
ColorButton * indicator
Definition: mperfwidget.h:38
QSpinBox * xBox0
QSignalMapper boxYMapper
Definition: mperfwidget.h:49
QSignalMapper buttonMapper2
Definition: mperfwidget.h:47
QSpinBox * yBox4
void enableChanged(int index)
void colorClicked(int index)
Definition: mperfwidget.cpp:81
QSpinBox * yBox0
bool isSetting
Definition: mperfwidget.h:53
QSlider * ySlider
Definition: mperfwidget.h:39
KbProfile * profile
Definition: mperfwidget.h:35
ColorButton * iButton1
QSlider * xSlider2
QSlider * ySlider2
QSignalMapper enableMapper
Definition: mperfwidget.h:50
QSlider * xSlider5
void colorChanged(int index)
Definition: mperfwidget.cpp:86
QSlider * xSlider1
QCheckBox * eBox2
QSignalMapper sliderYMapper
Definition: mperfwidget.h:48
void boxYChanged(int index)
bool colorLink
Definition: mperfwidget.h:45
QSlider * ySlider0
bool allowAlpha() const
Definition: colorbutton.h:17
static const QString xyLinkPath
Definition: mperfwidget.cpp:6
QSpinBox * yBox1
QSpinBox * yBox
Definition: mperfwidget.h:40
QSpinBox * yBox2
KbPerf * perf
Definition: mperfwidget.h:34
QSlider * xSlider4
QSpinBox * yBox5
ColorButton * iButton2
QCheckBox * xyBox
ColorButton * iButton4
QSignalMapper boxXMapper
Definition: mperfwidget.h:49
QSlider * ySlider3
QCheckBox * eBox5
QSlider * xSlider
Definition: mperfwidget.h:39
QSignalMapper buttonMapper1
Definition: mperfwidget.h:47
QSpinBox * xBox4
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43
QSlider * xSlider0
bool bigIcons() const
Definition: colorbutton.h:23
bool setLabel() const
Definition: colorbutton.h:20
void sliderYMoved(int index)
ColorButton * iButton3
void boxXChanged(int index)
QSlider * ySlider5

+ Here is the call graph for this function:

MPerfWidget::~MPerfWidget ( )

Definition at line 56 of file mperfwidget.cpp.

References ui.

56  {
57  delete ui;
58 }
Ui::MPerfWidget * ui
Definition: mperfwidget.h:32

Member Function Documentation

void MPerfWidget::boxXChanged ( int  index)
privateslot

Definition at line 157 of file mperfwidget.cpp.

References _xyLink, KbPerf::dpi(), dpiLog(), perf, SET_END, SET_START, stages, MPerfWidget::DpiUi::xBox, MPerfWidget::DpiUi::xSlider, and MPerfWidget::DpiUi::yBox.

Referenced by MPerfWidget().

157  {
158  SET_START;
159  QSpinBox* box = stages[index].xBox;
160  QSlider* slider = stages[index].xSlider;
161  int value = box->value();
162  slider->setValue(dpiLog(value, slider->minimum(), slider->maximum()));
163  if(_xyLink)
164  perf->dpi(index, value);
165  else
166  perf->dpi(index, QPoint(value, perf->dpi(index).y()));
167  SET_END;
168  if(_xyLink)
169  stages[index].yBox->setValue(value);
170 }
int dpiLog(int value, int min, int max)
bool _xyLink
Definition: mperfwidget.h:44
#define SET_START
QSpinBox * xBox
Definition: mperfwidget.h:40
QPoint dpi(int index) const
Definition: kbperf.h:50
#define SET_END
QSpinBox * yBox
Definition: mperfwidget.h:40
KbPerf * perf
Definition: mperfwidget.h:34
QSlider * xSlider
Definition: mperfwidget.h:39
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MPerfWidget::boxYChanged ( int  index)
privateslot

Definition at line 172 of file mperfwidget.cpp.

References _xyLink, KbPerf::dpi(), dpiLog(), perf, SET_END, SET_START, stages, MPerfWidget::DpiUi::xBox, MPerfWidget::DpiUi::yBox, and MPerfWidget::DpiUi::ySlider.

Referenced by MPerfWidget().

172  {
173  SET_START;
174  QSpinBox* box = stages[index].yBox;
175  QSlider* slider = stages[index].ySlider;
176  int value = box->value();
177  slider->setValue(dpiLog(value, slider->minimum(), slider->maximum()));
178  if(_xyLink)
179  perf->dpi(index, value);
180  else
181  perf->dpi(index, QPoint(perf->dpi(index).x(), value));
182  SET_END;
183  if(_xyLink)
184  stages[index].xBox->setValue(value);
185 }
int dpiLog(int value, int min, int max)
bool _xyLink
Definition: mperfwidget.h:44
#define SET_START
QSpinBox * xBox
Definition: mperfwidget.h:40
QSlider * ySlider
Definition: mperfwidget.h:39
QPoint dpi(int index) const
Definition: kbperf.h:50
#define SET_END
QSpinBox * yBox
Definition: mperfwidget.h:40
KbPerf * perf
Definition: mperfwidget.h:34
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MPerfWidget::colorChanged ( int  index)
privateslot

Definition at line 86 of file mperfwidget.cpp.

References ColorButton::color(), colorLink, DPI_COUNT, KbPerf::dpiColor(), Ui_MPerfWidget::iButtonO, MPerfWidget::DpiUi::indicator, KbPerf::OTHER, perf, stages, and ui.

Referenced by MPerfWidget().

86  {
87  QColor color = stages[index].indicator->color();
88  if(colorLink){
89  // Alt was held down - set all
90  for(int i = 0; i < DPI_COUNT; i++){
91  stages[i].indicator->color(color);
92  perf->dpiColor(i, color);
93  }
94  ui->iButtonO->color(color);
95  perf->dpiColor(KbPerf::OTHER, color);
96  } else {
97  // Set one
98  perf->dpiColor(index, color);
99  }
100  colorLink = false;
101 }
ColorButton * iButtonO
Ui::MPerfWidget * ui
Definition: mperfwidget.h:32
static const int DPI_COUNT
Definition: mperfwidget.h:28
const QColor & color() const
Definition: colorbutton.h:13
QColor dpiColor(int index) const
Definition: kbperf.h:85
ColorButton * indicator
Definition: mperfwidget.h:38
bool colorLink
Definition: mperfwidget.h:45
KbPerf * perf
Definition: mperfwidget.h:34
static const int OTHER
Definition: kbperf.h:84
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MPerfWidget::colorClicked ( int  index)
privateslot

Definition at line 81 of file mperfwidget.cpp.

References colorLink.

Referenced by MPerfWidget().

81  {
82  // Set all colors at once if Alt is held down
83  colorLink = !!(qApp->keyboardModifiers() & Qt::AltModifier);
84 }
bool colorLink
Definition: mperfwidget.h:45

+ Here is the caller graph for this function:

void MPerfWidget::enableChanged ( int  index)
privateslot

Definition at line 187 of file mperfwidget.cpp.

References KbPerf::dpiEnabled(), perf, and stages.

Referenced by MPerfWidget().

187  {
188  perf->dpiEnabled(index, stages[index].enableCheck->isChecked());
189 }
bool dpiEnabled(int index) const
Definition: kbperf.h:68
KbPerf * perf
Definition: mperfwidget.h:34
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MPerfWidget::on_aSnapBox_clicked ( bool  checked)
privateslot

Definition at line 201 of file mperfwidget.cpp.

References KbPerf::angleSnap(), and perf.

201  {
202  perf->angleSnap(checked);
203 }
bool angleSnap() const
Definition: kbperf.h:42
KbPerf * perf
Definition: mperfwidget.h:34

+ Here is the call graph for this function:

void MPerfWidget::on_copyButton_clicked ( )
privateslot

Definition at line 209 of file mperfwidget.cpp.

References KbProfile::currentMode(), KbProfile::modes(), perf, KbMode::perf(), profile, and ModeSelectDialog::selection().

209  {
210  ModeSelectDialog dialog(this, profile->currentMode(), profile->modes(), "Copy performance settings to:");
211  if(dialog.exec() != QDialog::Accepted)
212  return;
213  QList<KbMode*> selectedModes = dialog.selection();
214  foreach(KbMode* mode, selectedModes){
215  *mode->perf() = *perf;
216  }
217 }
KbMode * currentMode() const
Definition: kbprofile.h:54
const ModeList & modes() const
Definition: kbprofile.h:42
KbProfile * profile
Definition: mperfwidget.h:35
Definition: kbmode.h:36
KbPerf * perf
Definition: mperfwidget.h:34
QList< KbMode * > selection()
KbPerf * perf()
Definition: kbmode.h:62

+ Here is the call graph for this function:

void MPerfWidget::on_indicBox_clicked ( bool  checked)
privateslot

Definition at line 197 of file mperfwidget.cpp.

References KbPerf::dpiIndicator(), and perf.

197  {
198  perf->dpiIndicator(checked);
199 }
bool dpiIndicator() const
Definition: kbperf.h:82
KbPerf * perf
Definition: mperfwidget.h:34

+ Here is the call graph for this function:

void MPerfWidget::on_lHeightBox_activated ( int  index)
privateslot

Definition at line 205 of file mperfwidget.cpp.

References KbPerf::liftHeight(), and perf.

205  {
206  perf->liftHeight((KbPerf::height)(index + 1));
207 }
height liftHeight() const
Definition: kbperf.h:38
height
Definition: kbperf.h:31
KbPerf * perf
Definition: mperfwidget.h:34

+ Here is the call graph for this function:

void MPerfWidget::on_spinBox_valueChanged ( int  arg1)
privateslot

Definition at line 219 of file mperfwidget.cpp.

References KbPerf::iOpacity(), and perf.

219  {
220  if(!perf)
221  return;
222  perf->iOpacity(arg1 / 100.f);
223 }
KbPerf * perf
Definition: mperfwidget.h:34
float iOpacity() const
Definition: kbperf.h:79

+ Here is the call graph for this function:

void MPerfWidget::on_xyBox_clicked ( bool  checked)
privateslot

Definition at line 191 of file mperfwidget.cpp.

References _xyLink, CkbSettings::set(), and xyLinkPath.

191  {
192  _xyLink = !checked;
193  CkbSettings::set(xyLinkPath, checked);
194  // FIXME: update other MPerfWidgets, since this is a global setting
195 }
static void set(const QString &key, const QVariant &value)
bool _xyLink
Definition: mperfwidget.h:44
static const QString xyLinkPath
Definition: mperfwidget.cpp:6

+ Here is the call graph for this function:

void MPerfWidget::setPerf ( KbPerf newPerf,
KbProfile newProfile 
)

Definition at line 60 of file mperfwidget.cpp.

References _xyLink, KbPerf::angleSnap(), Ui_MPerfWidget::aSnapBox, ColorButton::color(), KbPerf::dpi(), DPI_COUNT, KbPerf::dpiColor(), KbPerf::dpiEnabled(), KbPerf::dpiIndicator(), MPerfWidget::DpiUi::enableCheck, Ui_MPerfWidget::iButtonO, MPerfWidget::DpiUi::indicator, Ui_MPerfWidget::indicBox, KbPerf::iOpacity(), Ui_MPerfWidget::lHeightBox, KbPerf::liftHeight(), KbPerf::OTHER, perf, profile, Ui_MPerfWidget::spinBox, stages, ui, MPerfWidget::DpiUi::xBox, and MPerfWidget::DpiUi::yBox.

Referenced by KbWidget::modeChanged().

60  {
61  perf = newPerf;
62  profile = newProfile;
63  ui->spinBox->setValue(round(perf->iOpacity() * 100.f));
64  for(int i = 0; i < DPI_COUNT; i++){
66  bool oldLink = _xyLink;
67  // Don't force X/Y to the same value if they were set differently in the past
68  _xyLink = false;
69  stages[i].xBox->setValue(perf->dpi(i).x());
70  stages[i].yBox->setValue(perf->dpi(i).y());
71  _xyLink = oldLink;
72  if(stages[i].enableCheck)
73  stages[i].enableCheck->setChecked(perf->dpiEnabled(i));
74  }
76  ui->aSnapBox->setChecked(perf->angleSnap());
77  ui->lHeightBox->setCurrentIndex(perf->liftHeight() - 1);
78  ui->indicBox->setChecked(perf->dpiIndicator());
79 }
ColorButton * iButtonO
bool _xyLink
Definition: mperfwidget.h:44
Ui::MPerfWidget * ui
Definition: mperfwidget.h:32
static const int DPI_COUNT
Definition: mperfwidget.h:28
bool dpiEnabled(int index) const
Definition: kbperf.h:68
const QColor & color() const
Definition: colorbutton.h:13
QCheckBox * enableCheck
Definition: mperfwidget.h:41
QColor dpiColor(int index) const
Definition: kbperf.h:85
QSpinBox * xBox
Definition: mperfwidget.h:40
ColorButton * indicator
Definition: mperfwidget.h:38
height liftHeight() const
Definition: kbperf.h:38
QCheckBox * aSnapBox
bool dpiIndicator() const
Definition: kbperf.h:82
QCheckBox * indicBox
KbProfile * profile
Definition: mperfwidget.h:35
QSpinBox * spinBox
QPoint dpi(int index) const
Definition: kbperf.h:50
QComboBox * lHeightBox
bool angleSnap() const
Definition: kbperf.h:42
QSpinBox * yBox
Definition: mperfwidget.h:40
KbPerf * perf
Definition: mperfwidget.h:34
static const int OTHER
Definition: kbperf.h:84
float iOpacity() const
Definition: kbperf.h:79
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MPerfWidget::sliderXMoved ( int  index)
privateslot

Definition at line 128 of file mperfwidget.cpp.

References _xyLink, KbPerf::dpi(), dpiExp(), dpiRound(), perf, SET_END, SET_START, stages, MPerfWidget::DpiUi::xBox, MPerfWidget::DpiUi::xSlider, and MPerfWidget::DpiUi::ySlider.

Referenced by MPerfWidget().

128  {
129  SET_START;
130  QSlider* slider = stages[index].xSlider;
131  int value = dpiRound(dpiExp(slider->value(), slider->minimum(), slider->maximum()));
132  stages[index].xBox->setValue(value);
133  if(_xyLink)
134  perf->dpi(index, value);
135  else
136  perf->dpi(index, QPoint(value, perf->dpi(index).y()));
137  SET_END;
138  if(_xyLink)
139  stages[index].ySlider->setValue(slider->value());
140 }
bool _xyLink
Definition: mperfwidget.h:44
#define SET_START
QSpinBox * xBox
Definition: mperfwidget.h:40
QSlider * ySlider
Definition: mperfwidget.h:39
QPoint dpi(int index) const
Definition: kbperf.h:50
#define SET_END
int dpiRound(int value)
KbPerf * perf
Definition: mperfwidget.h:34
int dpiExp(int value, int min, int max)
QSlider * xSlider
Definition: mperfwidget.h:39
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MPerfWidget::sliderYMoved ( int  index)
privateslot

Definition at line 142 of file mperfwidget.cpp.

References _xyLink, KbPerf::dpi(), dpiExp(), dpiRound(), perf, SET_END, SET_START, stages, ui, Ui_MPerfWidget::xyBox, MPerfWidget::DpiUi::yBox, and MPerfWidget::DpiUi::ySlider.

Referenced by MPerfWidget().

142  {
143  SET_START;
144  QSlider* slider = stages[index].ySlider;
145  int value = dpiRound(dpiExp(slider->value(), slider->minimum(), slider->maximum()));
146  stages[index].yBox->setValue(value);
147  if(_xyLink)
148  perf->dpi(index, value);
149  else
150  perf->dpi(index, QPoint(perf->dpi(index).x(), value));
151  SET_END;
152  if(!ui->xyBox->isChecked())
153  // X/Y linked?
154  stages[index].xSlider->setValue(slider->value());
155 }
bool _xyLink
Definition: mperfwidget.h:44
Ui::MPerfWidget * ui
Definition: mperfwidget.h:32
#define SET_START
QSlider * ySlider
Definition: mperfwidget.h:39
QPoint dpi(int index) const
Definition: kbperf.h:50
#define SET_END
int dpiRound(int value)
QSpinBox * yBox
Definition: mperfwidget.h:40
KbPerf * perf
Definition: mperfwidget.h:34
QCheckBox * xyBox
int dpiExp(int value, int min, int max)
DpiUi stages[DPI_COUNT]
Definition: mperfwidget.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

bool MPerfWidget::_xyLink
private
QSignalMapper MPerfWidget::boxXMapper
private

Definition at line 49 of file mperfwidget.h.

Referenced by MPerfWidget().

QSignalMapper MPerfWidget::boxYMapper
private

Definition at line 49 of file mperfwidget.h.

Referenced by MPerfWidget().

QSignalMapper MPerfWidget::buttonMapper1
private

Definition at line 47 of file mperfwidget.h.

Referenced by MPerfWidget().

QSignalMapper MPerfWidget::buttonMapper2
private

Definition at line 47 of file mperfwidget.h.

Referenced by MPerfWidget().

bool MPerfWidget::colorLink
private

Definition at line 45 of file mperfwidget.h.

Referenced by colorChanged(), and colorClicked().

const int MPerfWidget::DPI_COUNT = KbPerf::DPI_COUNT
static

Definition at line 28 of file mperfwidget.h.

Referenced by colorChanged(), MPerfWidget(), and setPerf().

const int MPerfWidget::DPI_MAX = KbPerf::DPI_MAX
static

Definition at line 29 of file mperfwidget.h.

const int MPerfWidget::DPI_MIN = KbPerf::DPI_MIN
static

Definition at line 29 of file mperfwidget.h.

QSignalMapper MPerfWidget::enableMapper
private

Definition at line 50 of file mperfwidget.h.

Referenced by MPerfWidget().

bool MPerfWidget::isSetting
private

Definition at line 53 of file mperfwidget.h.

KbProfile* MPerfWidget::profile
private

Definition at line 35 of file mperfwidget.h.

Referenced by on_copyButton_clicked(), and setPerf().

QSignalMapper MPerfWidget::sliderXMapper
private

Definition at line 48 of file mperfwidget.h.

Referenced by MPerfWidget().

QSignalMapper MPerfWidget::sliderYMapper
private

Definition at line 48 of file mperfwidget.h.

Referenced by MPerfWidget().

DpiUi MPerfWidget::stages[DPI_COUNT]
private
Ui::MPerfWidget* MPerfWidget::ui
private

Definition at line 32 of file mperfwidget.h.

Referenced by colorChanged(), MPerfWidget(), setPerf(), sliderYMoved(), and ~MPerfWidget().


The documentation for this class was generated from the following files: