Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 1.0
- Rectangle {
- width: 400
- height: 300
- color: "lightyellow"
- property int lineHeight: 30
- Component {
- id: demoDelegate
- Rectangle {
- color: "lightblue"
- width: 120
- height: lineHeight
- Text {
- text: model.index
- }
- }
- }
- ListView {
- id: view
- model: 6
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- width: childrenRect.width
- height: model * lineHeight
- delegate: demoDelegate
- }
- Component.onCompleted: {
- console.log("contentHeight: " + view.childrenRect.height)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement