return value;
}
+ function setFocus(){
+ text_input1.focus=true;
+ }
+
TextInput {
id: text_input1
x: 1
if(focus==false)
text=stringToInt(text);
}
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Up)
+ text_input1.text=((stringToInt(text_input1.text)+singleStep)>maxValue)?(maxValue):(stringToInt(text_input1.text)+singleStep);
+ else if (event.key == Qt.Key_Down){
+ text_input1.text=((stringToInt(text_input1.text)-singleStep)<minValue)?(minValue):(stringToInt(text_input1.text)-singleStep);
+ if(isTextInMinValue && stringToInt(text_input1.text)==minValue)
+ text_input1.text=textInMinValue
+ }
+ }
}
Timer {
timerDown.running=true;
}
}
+ states: [
+ State {
+ name: "focusState"; when: text_input1.focus && rectangle1.enabled;
+ PropertyChanges { target: rectangle1; border.width: 2 }
+ }
+ ]
}