make scroll view change height

This commit is contained in:
Tech 2016-03-08 10:23:04 -08:00
parent efcb9746e8
commit cdc44b6693
2 changed files with 3 additions and 2 deletions

View File

@ -303,7 +303,7 @@ func (sl *slide) addCell( /*cl *cell*/ ) {
var cl cell var cl cell
cl.index = len(*sl) cl.index = len(*sl)
window.ObjectByName("gridRect").Set("count", window.ObjectByName("gridRect").Int("count")+1)
cl.qmlcell = cellQml.Create(nil) cl.qmlcell = cellQml.Create(nil)
cl.qmlcell.Set("objectName", fmt.Sprintf("cellRect%d", len(*sl))) cl.qmlcell.Set("objectName", fmt.Sprintf("cellRect%d", len(*sl)))
cl.qmlcell.Set("parent", window.ObjectByName("data1")) cl.qmlcell.Set("parent", window.ObjectByName("data1"))

View File

@ -74,6 +74,7 @@ ApplicationWindow {
anchors.bottomMargin: 0 anchors.bottomMargin: 0
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0 anchors.topMargin: 0
property int count: 0
ScrollView { ScrollView {
id: scview id: scview
@ -84,7 +85,7 @@ ApplicationWindow {
id: gridData id: gridData
objectName: "gridData" objectName: "gridData"
width: scview.width width: scview.width
height: 100 height: gridRect.count*100
Rectangle { Rectangle {
id: col1 id: col1