make scroll view change height
This commit is contained in:
parent
efcb9746e8
commit
cdc44b6693
2
main.go
2
main.go
@ -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"))
|
||||||
|
3
main.qml
3
main.qml
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user