Overlapping Delegate in listview
-
http://www.2shared.com/file/-KWQrl3Z/xml_view.html
Cleaned up my code mate. Thanks. Iwill also try to do it with simple code.
-
here it is mate
@import QtQuick 1.1
Rectangle{
width:400 height:width property real ropacity:0 XmlListModel { id: xmlModel source:"example_grouping.xml" query: "/rss/channel/item" XmlRole { name: "id"; query: "id/string()" } XmlRole { name: "title"; query: "title/string()" } XmlRole { name: "pubDate"; query: "pubDate/string()" } XmlRole { name: "param"; query: "param/string()" } //onStatusChanged: if (status === XmlListModel.Ready) { console.log("XML elements read: ", count); fillListModel(); sortModel(); } } Component { id: sectionHeading Rectangle { id:rect1 width: 50 height:18 color: "lightgrey" Text { text: section font.bold: true } } } Component { id: mainDelegate Item { id: shortview property real detailsOpacity : 0 width: 100 height: 29 state : index==idLV.currentIndex ? 'details' : '' states: [ State { name: "" PropertyChanges { target: shortview; height:29;} PropertyChanges { target: tert; color:"black" } }, State { name: "details" ; PropertyChanges {target: shortview ; height:50; } PropertyChanges {target: tert ; color:"pink" } } ] Text { id:tert text:param color : "black" } MouseArea { id:marea anchors.fill:parent onClicked: idLV.currentIndex = index } } } ListView{ id:idLV model:xmlModel width: 180; height: 300 delegate: mainDelegate section.property: "param" section.criteria: ViewSection.FullString section.delegate: sectionHeading }
}@
-
The first item is always on 'Details' mode.
I have a close button on clikcing it goes back to the old state, when I click that I am unable to access the list.
Chk this if u have some time. Its the code which am working on.
http://www.2shared.com/file/d0BduoTK/xml.html"chk this":http://www.2shared.com/file/d0BduoTK/xml.html
Thanks