Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.5
- import QtQuick.Controls 2.5
- import QtQuick.Layouts 1.0
- Rectangle
- {
- id: root;
- height: 500;
- width: 200;
- ListView {
- id: myListView
- //Layout.preferredHeight: 100
- //Layout.fillWidth: true
- width: parent.width
- height: 100
- implicitWidth: contentWidth
- spacing: 10
- orientation: ListView.Horizontal
- snapMode: ListView.SnapToItem//SnapOneItem
- //layoutDirection: Qt.LeftToRight
- model: 4
- delegate: Rectangle {
- height: 50; width: 50
- color: "transparent"
- border.color: "blue"
- }
- //headerPositioning: ListView.InlineHeader //
- headerPositioning: ListView.OverlayHeader
- // header: Item {
- // Rectangle {
- // anchors.leftMargin: 10
- // anchors.left: parent.left
- // height: 100; width: 100
- // Rectangle {
- // anchors.fill: parent
- // color: 'blue'
- // //source: "image://icons/add"
- // }
- // color: "transparent"
- // border.color: "blue"
- // }
- // }
- header: Rectangle {
- id: headerItem
- property bool test: (myListView.visibleArea.xPosition*myListView.width > 50/2) ? true:false
- width: 120// myList.width
- height: 30
- //z: 2
- color: "blue"
- Text {
- text: test //+ myListView.visibleArea.xPosition*myListView.width
- color: "red"
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement