Important: Please read the Qt Code of Conduct -

Creating a complex List Model in QML

  • I am using a ListView to display data. For that I use Component as a delegate and ListModel as the model to create rows in the ListView:

    Below image is the use case for the design:

    enter image description here

    I use a function to create the model based on the data received from the C++. But since rows and columns are dynamic and also each small box as a checkbox to display I am not getting how to populate/create a model for this.

    function createModel(){
        for(var rows = 0 ; rows < 10; rows++)
            ListModel.append({}) //How to add data to model like a group based on the row and col ?

    As each small rectangle as checkboxes and columns are dynamic how to append data to the ListModel?

    Please Suggest.