Created
July 23, 2017 18:57
-
-
Save rburchell/3026d3229d4211f71b947e3f9eee6d9f to your computer and use it in GitHub Desktop.
artificial scrolling GC testcase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.6 | |
ListView { | |
id: lv | |
width: 300 | |
height: 1200 | |
model: 10000 | |
delegate: Rectangle { | |
width: ListView.view.width | |
height: 50 | |
color: index % 2 == 0 ? "red" : "blue" | |
opacity: 0.2 | |
Row { | |
anchors.fill: parent | |
Image { | |
source: "pony0.jpg" | |
height: parent.height | |
width: 30 | |
} | |
Image { | |
source: "pony1.jpg" | |
height: parent.height | |
width: 30 | |
} | |
Image { | |
source: "pony2.jpg" | |
height: parent.height | |
width: 30 | |
} | |
} | |
} | |
// uncomment the below to make it super super artificial (it'll scroll the | |
// whole ListView repeatedly). | |
/* | |
NumberAnimation { | |
id: scrollDown | |
target: lv | |
property: "contentY" | |
to: lv.contentHeight - lv.height | |
duration: 100 | |
onRunningChanged: { | |
if (!running) { | |
scrollUp.start() | |
} | |
} | |
} | |
NumberAnimation { | |
id: scrollUp | |
target: lv | |
property: "contentY" | |
to: 0 | |
duration: 100 | |
onRunningChanged: { | |
if (!running) { | |
scrollDown.start() | |
} | |
} | |
} | |
Component.onCompleted: { | |
scrollDown.start() | |
}*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment