demos/declarative/rssnews/rssnews.qml
changeset 37 758a864f9613
parent 30 5dc02b23752f
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    69             ListView {
    69             ListView {
    70                 focus: true
    70                 focus: true
    71                 id: categories
    71                 id: categories
    72                 anchors.fill: parent
    72                 anchors.fill: parent
    73                 model: rssFeeds
    73                 model: rssFeeds
       
    74                 footer: quitButtonDelegate
    74                 delegate: CategoryDelegate {}
    75                 delegate: CategoryDelegate {}
    75                 highlight: Rectangle { color: "steelblue" }
    76                 highlight: Rectangle { color: "steelblue" }
    76                 highlightMoveSpeed: 9999999
    77                 highlightMoveSpeed: 9999999
    77             }
    78             }
    78             ScrollBar {
    79             ScrollBar {
    85             width: window.width - 220; height: window.height
    86             width: window.width - 220; height: window.height
    86             model: feedModel
    87             model: feedModel
    87             delegate: NewsDelegate {}
    88             delegate: NewsDelegate {}
    88         }
    89         }
    89     }
    90     }
    90 
    91     Component {
       
    92         id: quitButtonDelegate
       
    93         Item {
       
    94             width: categories.width; height: 60
       
    95             Text {
       
    96                 text: "Quit"
       
    97                 font { family: "Helvetica"; pixelSize: 16; bold: true }
       
    98                 anchors {
       
    99                     left: parent.left; leftMargin: 15
       
   100                     verticalCenter: parent.verticalCenter
       
   101                 }
       
   102             }
       
   103             MouseArea {
       
   104                 anchors.fill: parent
       
   105                 onClicked: Qt.quit()
       
   106             }
       
   107         }
       
   108     }
    91     ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
   109     ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
    92     Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" }
   110     Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" }
    93 }
   111 }