iCub-main
Loading...
Searching...
No Matches
icub-main
src
tools
FirmwareUpdater
customspinbox.cpp
Go to the documentation of this file.
1
#include "
customspinbox.h
"
2
3
CustomSpinBox::CustomSpinBox
(icubCanProto_boardType_t boardType,QWidget *parent) : QSpinBox(parent)
4
{
5
setMinimum(0);
6
if
(boardType == icubCanProto_boardType__strain2 || boardType == icubCanProto_boardType__strain2c){
7
setMaximum(0xFFFF);
8
}
else
{
9
setMaximum(0x3FF);
10
}
11
setStyleSheet(
"font: 9pt"
);
12
modified =
false
;
13
connect(
this
,SIGNAL(valueChanged(
int
)),
this
,SLOT(onValueChanged(
int
)));
14
}
15
16
17
void
CustomSpinBox::setData
(QVariant v)
18
{
19
data = v;
20
}
21
22
QVariant
CustomSpinBox::getData
()
23
{
24
return
data;
25
}
26
27
void
CustomSpinBox::clear
()
28
{
29
modified =
false
;
30
//setValue(previousValue);
31
setStyleSheet(
"font: 9pt"
);
32
}
33
34
void
CustomSpinBox::setCurrentValue
(
int
v)
35
{
36
if
(v == value() || modified){
37
return
;
38
}
39
40
blockSignals(
true
);
41
setValue(v);
42
previousValue = v;
43
blockSignals(
false
);
44
}
45
46
void
CustomSpinBox::onValueChanged(
int
v)
47
{
48
modified =
true
;
49
setStyleSheet(
"color: rgb(239, 41, 41);"
50
"font: bold 9pt"
);
51
52
}
CustomSpinBox::setCurrentValue
void setCurrentValue(int v)
Definition
customspinbox.cpp:34
CustomSpinBox::getData
QVariant getData()
Definition
customspinbox.cpp:22
CustomSpinBox::clear
void clear()
Definition
customspinbox.cpp:27
CustomSpinBox::setData
void setData(QVariant v)
Definition
customspinbox.cpp:17
CustomSpinBox::CustomSpinBox
CustomSpinBox(icubCanProto_boardType_t boardType, QWidget *parent=nullptr)
Definition
customspinbox.cpp:3
customspinbox.h
Generated on Wed Dec 18 2024 16:34:48 for iCub-main by
1.9.8