In my Qt quick application I use c++ to generate a number between 1 and 6, which is then sent with a signal to a QML function. I have six custom Block objects or elements (I’m not sure what you call them). The blocks are called block1 – 6. I want the the function to something like block"i".visible = true, but I’m not sure exactly how to do that. If someone could please help it would be greatly appreciated.
In my Qt quick application I use c++ to generate a number between 1
Share
instead of declaring 6 individual blocks, declare an array of size six and you can do like this
block[i].visible = true.