6 border.color: "#000666";
7 property int maxValue:500;
8 property int minValue:0;
9 property alias value:text_input1.text
11 signal valueChange(int intiger);
13 function stringToInt(string){
16 for (var i=string.length-1;i>=0;i--){
17 value+=(string.charCodeAt(i)-48)*pow10;
30 width: rectangle1.width-15
31 height: rectangle1.height*0.6;
33 anchors.centerIn: parent
34 validator: IntValidator{bottom: minValue; top: maxValue;}
35 transformOrigin: Item.Left
37 font.pixelSize: rectangle1.height * .5;
38 onCursorPositionChanged: moveCursorSelection(cursorPosition);
39 onTextChanged: rectangle1.valueChange(stringToInt(text_input1.text));
42 text=stringToInt(text);
52 if(mouseAreaUp.pressedButtons==Qt.LeftButton)
53 text_input1.text=((stringToInt(text_input1.text)+1)>maxValue)?(maxValue):(stringToInt(text_input1.text)+1);
65 if(mouseAreaDown.pressedButtons==Qt.LeftButton)
66 text_input1.text=((stringToInt(text_input1.text)-1)<minValue)?(minValue):(stringToInt(text_input1.text)-1);
75 height: parent.height;
76 anchors.centerIn: parent;
87 anchors.right: parent.right
88 anchors.top: parent.top
89 anchors.rightMargin: 2
91 source: "qrc:/button/up_enable.png";
99 anchors.right: parent.right
100 anchors.bottom: parent.bottom
101 anchors.rightMargin: 2
102 anchors.bottomMargin: 2
103 source: "qrc:/button/down_enable.png";
110 height: rectangle1.height/2;
111 anchors.right: parent.right
112 anchors.top: parent.top
113 onClicked: text_input1.text=((stringToInt(text_input1.text)+1)>maxValue)?(maxValue):(stringToInt(text_input1.text)+1);
116 timerUp.running=true;
124 height: rectangle1.height/2;
125 anchors.right: parent.right
126 anchors.bottom: parent.bottom
127 onClicked: text_input1.text=((stringToInt(text_input1.text)-1)<minValue)?(minValue):(stringToInt(text_input1.text)-1);
130 timerDown.running=true;
136 name: "DisableState"; when: rectangle1.enabled==false;
137 PropertyChanges { target: shadeDisable; z: 3; opacity: 0.5 }