property int expandedHeight
property int basicHeight
property string startValue
- height: basicHeight
+ height: 20
+
+ property variant parentField : rectangle1
function show(Boolean){
expanded = Boolean
signal valueSelected(string selected);
+ /* Keys.onPressed: {
+ console.log("tu ----");
+ if (event.key == Qt.Key_Escape)
+ rectangle1.expanded=false;
+ else if (event.key == Qt.Key_Space)
+ rectangle1.expanded=true;
+ else if (event.key == Qt.Key_Return){
+ rectangle1.expanded=false;
+ console.log("tu enter "+list1.content);
+ }
+ }
+ */
+
Text {
id: text1
width: rectangle1.width-15
anchors.centerIn: parent
font.pixelSize: rectangle1.height * .5;
onTextChanged: { rectangle1.valueSelected(text) }
+ z: expanded?0:1;
}
Rectangle {
ElementsListView{
id: list1
- width: parent.width
visible: false
- z: 0
property string selected: rectangle1.startValue
function selectedValue(nr, value) {
rectangle1.show(false)
}
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- highlightResizeSpeed: 1000
+ anchors.rightMargin: 5
+ anchors.leftMargin: 5
+ anchors.bottomMargin: 10
+ anchors.topMargin: 10
+ anchors.fill: parent
+ highlightResizeSpeed: 1000
delegate: Component{
id: list1Delegate
Item {
id: contentText
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 5
+ elide: Text.ElideRight;
text: content
}
}
when: (rectangle1.expanded == true && rectangle1.disabled == false)
PropertyChanges { target: list1; z: 10; visible: true }
PropertyChanges { target: text1; z: 10; visible: false }
- PropertyChanges { target: rectangle1; border.width: 0}
+ PropertyChanges { target: rectangle1; border.width: 1}
PropertyChanges { target: rectangle1; height: rectangle1.expandedHeight}
PropertyChanges { target: imageDown; height: 0.5 * rectangle1.basicHeight}
PropertyChanges { target: shadeDisable; visible: false; z: -1}
+ PropertyChanges { target: rectangle1; anchors.fill: parentField}
},
State {
name: "disabled";