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 console.log("tu ----");
32 if (event.key == Qt.Key_Escape)
33 rectangle1.expanded=false;
34 else if (event.key == Qt.Key_Space)
35 rectangle1.expanded=true;
36 else if (event.key == Qt.Key_Return){
37 rectangle1.expanded=false;
38 console.log("tu enter "+list1.content);
45 width: rectangle1.width-15
46 height: rectangle1.height*0.6;
48 anchors.centerIn: parent
49 font.pixelSize: rectangle1.height * .5;
50 onTextChanged: { rectangle1.valueSelected(text) }
57 height: parent.height;
58 anchors.centerIn: parent;
68 height: 0.5 * rectangle1.height;
69 anchors.top: parent.top
70 anchors.right: parent.right
72 anchors.rightMargin: 6
73 anchors.bottomMargin: 4
74 source: "qrc:/button/down_enable.png";
80 rectangle1.show(!rectangle1.expanded)
90 rectangle1.show(!rectangle1.expanded)
97 property string selected: rectangle1.startValue
99 function selectedValue(nr, value) {
102 rectangle1.show(false)
105 anchors.rightMargin: 5
106 anchors.leftMargin: 5
107 anchors.bottomMargin: 10
108 anchors.topMargin: 10
111 highlightResizeSpeed: 1000
115 width: rectangle1.width
116 height: contentText.height
123 list1.selectedValue(number, content)
127 list1.currentIndex = number
136 anchors.verticalCenter: parent.verticalCenter
137 anchors.leftMargin: 5
138 elide: Text.ElideRight;
150 when: (rectangle1.expanded == false && rectangle1.disabled == false)
151 PropertyChanges { target: list1; z: 0; visible: false }
152 PropertyChanges { target: text1; z: 0; visible: true }
153 PropertyChanges { target: rectangle1; border.width: 1}
154 PropertyChanges { target: rectangle1; height: rectangle1.basicHeight}
155 PropertyChanges { target: imageDown; height: 0.5 * rectangle1.basicHeight}
156 PropertyChanges { target: shadeDisable; visible: false; z:-1}
160 when: (rectangle1.expanded == true && rectangle1.disabled == false)
161 PropertyChanges { target: list1; z: 10; visible: true }
162 PropertyChanges { target: text1; z: 10; visible: false }
163 PropertyChanges { target: rectangle1; border.width: 1}
164 PropertyChanges { target: rectangle1; height: rectangle1.expandedHeight}
165 PropertyChanges { target: imageDown; height: 0.5 * rectangle1.basicHeight}
166 PropertyChanges { target: shadeDisable; visible: false; z: -1}
167 PropertyChanges { target: rectangle1; anchors.fill: parentField}
171 when: rectangle1.disabled == true
172 PropertyChanges { target: list1; z: 0; visible: false }
173 PropertyChanges { target: text1; z: 0; visible: true }
174 PropertyChanges { target: rectangle1; border.width: 1}
175 PropertyChanges { target: rectangle1; expanded: false}
176 PropertyChanges { target: rectangle1; height: rectangle1.basicHeight}
177 PropertyChanges { target: imageDown; visible: true}
178 PropertyChanges { target: shadeDisable; visible: true; z:10}