Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 2.0;
  2.  
  3. Rectangle {
  4.     width: 300;
  5.     height: 400;
  6.  
  7.     ListModel {
  8.         id: modelTest;
  9.         Component.onCompleted: {
  10.             for (var idx = 0; idx < 1000; idx++) {
  11.                 append ({ "title" : "Item %1".arg (idx +1) });
  12.             }
  13.         }
  14.     }
  15.     ListView {
  16.         id: list1;
  17.         model: modelTest;
  18.         delegate: Text { text: model.title; }
  19.         anchors {
  20.             top: parent.top;
  21.             left: parent.left;
  22.             right: parent.horizontalCenter;
  23.             bottom: parent.bottom;
  24.         }
  25.  
  26.         Binding on contentY {
  27.             value: list2.contentY;
  28.             when: !list1.flicking;
  29.         }
  30.     }
  31.     ListView {
  32.         id: list2;
  33.         model: modelTest;
  34.         delegate: Text { text: model.title; }
  35.         anchors {
  36.             top: parent.top;
  37.             left: parent.horizontalCenter;
  38.             right: parent.right;
  39.             bottom: parent.bottom;
  40.         }
  41.  
  42.         Binding on contentY {
  43.             value: list1.contentY;
  44.             when: !list2.flicking;
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement