serachBar + progressBar
[mdictionary] / src / mdictionary / qml / MyTextLineEdit.qml
1 import Qt 4.7
2
3 Rectangle {
4     id: rectangle1
5     radius: 10
6     border.color: "#000666";
7     property alias textInLineEdit:text_input1.text
8
9     signal enterPressed(string text);
10
11     function setText(string) { textInLineEdit = string; }
12
13     TextInput {
14         id: text_input1
15         width: rectangle1.width-20
16         height: rectangle1.height*0.6;
17         text: "textInput"
18         transformOrigin: Item.Left
19         anchors.centerIn: parent
20         selectByMouse: true;
21         font.pixelSize: rectangle1.height * .5;
22         onCursorPositionChanged:  moveCursorSelection(cursorPosition);
23         activeFocusOnPress: true;
24         Keys.onPressed: {
25             if ((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return))
26                 rectangle1.enterPressed(text_input1.text)
27         }
28     }
29
30     Rectangle {
31         id: shadeDisable
32         anchors.centerIn: parent;
33         radius: parent.radius
34         color: "grey";
35         opacity: 0
36         width:  parent.width;
37         height: parent.height;
38     }
39
40     states: [
41         State {
42             name: "FokusState"; when: text_input1.focus==true && rectangle1.enabled==true;
43             PropertyChanges {
44                 target: rectangle1
45                 border.width: 3
46             }
47         },
48         State {
49             name: "DisableState"; when: rectangle1.enabled==false;
50             PropertyChanges { target: shadeDisable; z: 3; opacity: 0.5 }
51         }
52     ]
53 }