Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0;
- Rectangle {
- width: 300;
- height: 400;
- ListModel {
- id: modelTest;
- Component.onCompleted: {
- for (var idx = 0; idx < 1000; idx++) {
- append ({ "title" : "Item %1".arg (idx +1) });
- }
- }
- }
- ListView {
- id: list1;
- model: modelTest;
- delegate: Text { text: model.title; }
- anchors {
- top: parent.top;
- left: parent.left;
- right: parent.horizontalCenter;
- bottom: parent.bottom;
- }
- Binding on contentY {
- value: list2.contentY;
- when: !list1.flicking;
- }
- }
- ListView {
- id: list2;
- model: modelTest;
- delegate: Text { text: model.title; }
- anchors {
- top: parent.top;
- left: parent.horizontalCenter;
- right: parent.right;
- bottom: parent.bottom;
- }
- Binding on contentY {
- value: list1.contentY;
- when: !list2.flicking;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement