TuiNodeDouble.cpp   TuiNodeDouble.cpp 
skipping to change at line 42 skipping to change at line 42
{ {
TuiNodeResponse response; TuiNodeResponse response;
response.accepted = false; response.accepted = false;
response.newNode = this; response.newNode = this;
if (key==Qt::Key_Left || key==Qt::Key_Return) if (key==Qt::Key_Left || key==Qt::Key_Return)
{ {
typing = false; typing = false;
typedDecimal = false; typedDecimal = false;
editing = false; editing = false;
response.accepted = true; response.accepted = true;
response.newNode = this;
stringValue.setNum(value,'g',-1); stringValue.setNum(value,'g',-1);
emit(setValue(value)); emit(setValue(value));
return response; return response;
} }
else if (key==Qt::Key_Up) else if (key==Qt::Key_Up)
{ {
typing = false; typing = false;
typedDecimal = false; typedDecimal = false;
value+=increment; value+=increment;
if (value > maximum) if (value > maximum)
value = maximum; value = maximum;
response.accepted = true; response.accepted = true;
response.newNode = this;
stringValue.setNum(value,'g',-1); stringValue.setNum(value,'g',-1);
emit(setValue(value)); emit(setValue(value));
return response; return response;
} }
else if (key==Qt::Key_Down) else if (key==Qt::Key_Down)
{ {
typing = false; typing = false;
typedDecimal = false; typedDecimal = false;
value-=increment; value-=increment;
if (value < minimum) if (value < minimum)
value = minimum; value = minimum;
response.accepted = true; response.accepted = true;
response.newNode = this;
stringValue.setNum(value,'g',-1); stringValue.setNum(value,'g',-1);
emit(setValue(value)); emit(setValue(value));
return response; return response;
} }
else if (key==Qt::Key_Period) else if (key==Qt::Key_Period)
{ {
if (!typing) if (!typing)
{ {
value = 0; value = 0;
stringValue.clear(); stringValue.clear();
skipping to change at line 91 skipping to change at line 88
else else
{ {
// first check if there already a decimal point // first check if there already a decimal point
if (!stringValue.contains('.')) if (!stringValue.contains('.'))
{ {
stringValue.setNum(value,'g',-1).append('.') ; stringValue.setNum(value,'g',-1).append('.') ;
typedDecimal = true; typedDecimal = true;
} }
} }
response.accepted = true; response.accepted = true;
response.newNode = this;
} }
else if (key>=Qt::Key_0 && key<=Qt::Key_9) else if (key>=Qt::Key_0 && key<=Qt::Key_9)
{ {
if (!typing) if (!typing)
typing = true; typing = true;
stringValue.append(QString::number(key - Qt::Key_0)); stringValue.append(QString::number(key - Qt::Key_0));
bool ok; bool ok;
double d = stringValue.toDouble(&ok); double d = stringValue.toDouble(&ok);
skipping to change at line 132 skipping to change at line 128
{ {
stringValue.chop(1); stringValue.chop(1);
bool ok; bool ok;
double d = stringValue.toDouble(&ok); double d = stringValue.toDouble(&ok);
if (ok && d>=minimum && d<=maximum) if (ok && d>=minimum && d<=maximum)
{ {
value = d; value = d;
} }
} }
response.accepted = true; response.accepted = true;
response.newNode = this;
emit(setValue(value)); emit(setValue(value));
return response; return response;
} }
else if (key==Qt::Key_Minus) else if (key==Qt::Key_Minus)
{ {
typing = true; typing = true;
int i = value *= -1; //BM: Is this deliberate? int i = value *= -1; //BM: Is this deliberate?
if (i>=minimum && i<=maximum) if (i>=minimum && i<=maximum)
value = i; value = i;
stringValue.setNum(value,'g',-1);; stringValue.setNum(value,'g',-1);;
response.accepted = true; response.accepted = true;
response.newNode = this;
emit(setValue(value)); emit(setValue(value));
return response; return response;
} }
return response; return response;
} }
QString TuiNodeDouble::getDisplayText() QString TuiNodeDouble::getDisplayText()
{ {
if (!editing) if (!editing)
{ {
 End of changes. 6 change blocks. 
6 lines changed or deleted 0 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/