6 border.color: "#000666";
7 property alias value:text1.text
8 property alias index: list1.currentIndex
9 property alias model: list1.model
10 property bool expanded: false
11 property bool disabled: false
12 property int expandedHeight
13 property int basicHeight
14 property string startValue
17 property variant parentField : rectangle1
19 function show(Boolean){
23 function setStartValue(val, idx){
25 list1.currentIndex = idx
28 signal valueSelected(string selected);
31 if (event.key == Qt.Key_Space)
32 rectangle1.expanded=true;
37 width: rectangle1.width-15
38 height: rectangle1.height*0.6;
40 anchors.centerIn: parent
41 font.pixelSize: rectangle1.height * .5;
42 onTextChanged: { rectangle1.valueSelected(text) }
49 height: parent.height;
50 anchors.centerIn: parent;
60 height: 0.5 * rectangle1.height;
61 anchors.top: parent.top
62 anchors.right: parent.right
64 anchors.rightMargin: 6
65 anchors.bottomMargin: 4
66 source: "qrc:/button/down_enable.png";
72 rectangle1.show(!rectangle1.expanded)
82 rectangle1.show(!rectangle1.expanded)
89 property string selected: rectangle1.startValue
93 if ((event.key == Qt.Key_Return || event.key == Qt.Key_Enter) && currentIndex >= 0){
94 selectedValue(currentIndex, model.valueOnPosition(currentIndex))
96 if (event.key == Qt.Key_Escape){
97 rectangle1.show(!rectangle1.expanded)
102 function selectedValue(nr, value) {
105 rectangle1.show(false)
108 anchors.rightMargin: 5
109 anchors.leftMargin: 5
110 anchors.bottomMargin: 10
111 anchors.topMargin: 10
114 highlightResizeSpeed: 1000
118 width: rectangle1.width
119 height: contentText.height
126 list1.selectedValue(number, content)
130 list1.currentIndex = number
139 anchors.verticalCenter: parent.verticalCenter
140 anchors.leftMargin: 5
141 elide: Text.ElideRight;
153 when: (rectangle1.expanded == false && rectangle1.disabled == false)
154 PropertyChanges { target: list1; z: 0; visible: false }
155 PropertyChanges { target: text1; z: 0; visible: true }
156 PropertyChanges { target: rectangle1; border.width: 1}
157 PropertyChanges { target: rectangle1; height: rectangle1.basicHeight}
158 PropertyChanges { target: imageDown; height: 0.5 * rectangle1.basicHeight}
159 PropertyChanges { target: shadeDisable; visible: false; z:-1}
163 when: (rectangle1.expanded == true && rectangle1.disabled == false)
164 PropertyChanges { target: list1; z: 10; visible: true }
165 PropertyChanges { target: text1; z: 10; visible: false }
166 PropertyChanges { target: rectangle1; border.width: 1}
167 PropertyChanges { target: rectangle1; height: rectangle1.expandedHeight}
168 PropertyChanges { target: imageDown; height: 0.5 * rectangle1.basicHeight}
169 PropertyChanges { target: shadeDisable; visible: false; z: -1}
170 PropertyChanges { target: rectangle1; anchors.fill: parentField}
174 when: rectangle1.disabled == true
175 PropertyChanges { target: list1; z: 0; visible: false }
176 PropertyChanges { target: text1; z: 0; visible: true }
177 PropertyChanges { target: rectangle1; border.width: 1}
178 PropertyChanges { target: rectangle1; expanded: false}
179 PropertyChanges { target: rectangle1; height: rectangle1.basicHeight}
180 PropertyChanges { target: imageDown; visible: true}
181 PropertyChanges { target: shadeDisable; visible: true; z:10}