April 2018
Beginner
714 pages
18h 21m
English
Our code works, but the way we create the rods is not ideal. First, enumerating rods and their indices in Scene.qml is inconvenient and error-prone. Second, we'll need to have a way to access a Rod object by its index, and the current approach doesn't allow that. In the previous chapters, we dealt with repeating Qt Quick objects using the Repeater QML type. However, Repeater doesn't work for Entity objects. It's only able to handle types that inherit from Qt Quick Item.
The solution to our problem is already familiar to you since Chapter 12, Customization in Qt Quick. We can create QML objects using imperative JavaScript code. Remove Rod objects from the Scene.qml file and make the following additions ...
Read now
Unlock full access