Skip to content

Instantly share code, notes, and snippets.

@rschroll
Last active December 22, 2015 15:19
Show Gist options
  • Select an option

  • Save rschroll/6491639 to your computer and use it in GitHub Desktop.

Select an option

Save rschroll/6491639 to your computer and use it in GitHub Desktop.
A test case demonstrating problems with setting flickable = null in the Ubuntu SDK. (Now fixed!)
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1
MainView {
width: units.gu(50)
height: units.gu(75)
Page {
id: page
title: "Page Title"
flickable: listView
ListView {
id: listView
anchors {
top: parent.top
left: parent.left
right: parent.right
bottom: button.top
}
model: 20
delegate: Standard { text: "Testing " + modelData }
clip: true
}
Button {
id: button
text: page.flickable ? "De-flickate" : "Re-flickate"
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
onClicked: {
page.flickable = (page.flickable ? null : listView)
if (page.flickable == null)
listView.topMargin = 0
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment