@J-Hilk
Ok that's enough I think.
One more question what will happen to scrolleft().
If I keep on incrementing these, will there be any increase in runtime memory or processor load?
Thanks for the reply @SGaist. What I wanted was to update some data (in form of text) from python backend, most of the tutorials I saw were based on using signals and slots. were as I only needed a slot to read without any triggering signal. Though I've been able to finally figure it out and spending this much time actually made me understood it more. I used QTimer to refresh the backend function every half a second.
@jeremy_k I'm now looking at a template based solution as suggested on the SO question (https://stackoverflow.com/a/65401996/447438). The ideas has been in my head for a couple of days, and the post pushed me to look more deeply into it.
What you want is a default alias property :
CustomControl.qml:
Column {
default property alias innerColumnData: innerColumn.data
property alias title: label.text
Label {
id: label
}
Column {
id: innerColumn
}
}
usage:
CustomControl {
title: "Firstname"
TextField {} // text field will be put as a child of innerColumn, (equivalent to innerColumnData: TextField {})
}
Good idea, i will try that as soon as i find some spare time.
Though, that cannot be the final solution. I would have to copy too much code.
So, what's the right way of doing it?
@TonyN GridView doesnot have the facility to get items using columns. AFAIK your current solution is the only way to go. Btw inside GridView you already have the index attached property.