6 border.color: "#000666";
7 property int maxValue:500;
8 property int minValue:0;
9 property alias value:text_input1.text
10 property bool isTextInMinValue:true;
11 property string textInMinValue:"inf";
12 property int singleStep: 2;
14 signal valueChange(int intiger);
16 function stringToInt(string){
19 if(isTextInMinValue && textInMinValue==string)
22 for (var i=string.length-1;i>=0;i--){
23 value+=(string.charCodeAt(i)-48)*pow10;
36 width: rectangle1.width-15
37 height: rectangle1.height*0.6;
39 anchors.centerIn: parent
40 validator: IntValidator{bottom: minValue; top: maxValue;}
41 transformOrigin: Item.Left
43 font.pixelSize: rectangle1.height * .5;
44 onCursorPositionChanged: moveCursorSelection(cursorPosition);
46 if(isTextInMinValue && text_input1.text!="" && stringToInt(text_input1.text)==minValue)
47 text_input1.text=textInMinValue;
49 rectangle1.valueChange(stringToInt(text_input1.text));
53 text=stringToInt(text);
63 if(mouseAreaUp.pressedButtons==Qt.LeftButton)
64 text_input1.text=((stringToInt(text_input1.text)+singleStep)>maxValue)?(maxValue):(stringToInt(text_input1.text)+singleStep);
76 if(mouseAreaDown.pressedButtons==Qt.LeftButton){
77 text_input1.text=((stringToInt(text_input1.text)-singleStep)<minValue)?(minValue):(stringToInt(text_input1.text)-singleStep);
78 if(isTextInMinValue && stringToInt(text_input1.text)==minValue)
79 text_input1.text=textInMinValue
89 height: parent.height;
90 anchors.centerIn: parent;
101 anchors.right: parent.right
102 anchors.top: parent.top
103 anchors.rightMargin: 2
105 source: "qrc:/button/up_enable.png";
113 anchors.right: parent.right
114 anchors.bottom: parent.bottom
115 anchors.rightMargin: 2
116 anchors.bottomMargin: 2
117 source: "qrc:/button/down_enable.png";
124 height: rectangle1.height/2;
125 anchors.right: parent.right
126 anchors.top: parent.top
127 onClicked: text_input1.text=((stringToInt(text_input1.text)+singleStep)>maxValue)?(maxValue):(stringToInt(text_input1.text)+singleStep);
130 timerUp.running=true;
138 height: rectangle1.height/2;
139 anchors.right: parent.right
140 anchors.bottom: parent.bottom
142 text_input1.text=((stringToInt(text_input1.text)-singleStep)<minValue)?(minValue):(stringToInt(text_input1.text)-singleStep);
143 if(isTextInMinValue && stringToInt(text_input1.text)==minValue)
144 text_input1.text=textInMinValue
148 timerDown.running=true;