add setingWidget Qml
[mdictionary] / src / mdictionary / qml / MySpinBox.qml
index c248bbe..9f0d47c 100644 (file)
@@ -31,14 +31,16 @@ Rectangle {
         height: rectangle1.height*0.6;
         text: "123"
         anchors.centerIn: parent
-        validator: IntValidator{bottom: 0; top: 500;}
+        validator: IntValidator{bottom: minValue; top: maxValue;}
         transformOrigin: Item.Left
         selectByMouse: true;
         font.pixelSize: rectangle1.height * .5;
         onCursorPositionChanged:  moveCursorSelection(cursorPosition);
-        //focus: rectangle1.focus;
         onTextChanged: rectangle1.valueChange(stringToInt(text_input1.text));
-
+        onFocusChanged: {
+            if(focus==false)
+               text=stringToInt(text);
+        }
     }
 
     Timer {