Loop or linear traverse to fill qml-objects
Say I have a text file with each line mentioning dimension of different rectangles, and their colors that i need to draw in certain fashion on the screen. I am able to load these details into some C++ structure object, and now I am trying to draw them using grid, or simply in linear fashion. How can I keep reading details of next rectangle from Qml, and then stop when the last rectangle is read? Is signal/slot helpful in doing so?
Please guide me. Any link to sample code example will be helpful in this regards.
i am very new to Qt and QML as well.
But this sound to me as your text file could be the model of a component using a delegate to draw one rectangle.
if you are not already familiar with the model/delegate concept you could check the docu.
maybe this helps
Thanks Stefan. I will have a look into this.