Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Add object to QAbstractListmodel-derived model from QML

$
0
0
Now going through your original way, 1. Registering the Game. 2. Embed Game in Component [qt-project.org]. 3. Create the Game object dynamically using createObject [qt-project.org] 4. Then store that object in an array . For eg. Component {    id: component    Game {} }   property var gameArray: [] var obj = component.createObject(myGame) gameArray.push(obj) 5. Then access it, var obj = array[gameArray] console.log(obj.color)

Viewing all articles
Browse latest Browse all 4972

Trending Articles