title: How I can i have access role of QAbstractListModel that is an Array?
body: <p>Maybe my question isn't clear but i hope that with the code my problem become more clear.
  I have a created these two structs and i use them in FormModel class   :</p>
  
  <pre><code>struct Tile
  {
      QString name;
      QString color;
  };  Q_DECLARE_METATYPE(Tile)
  
  struct Form
  {
      QString nameForm;
      Tile grid[9] ;   // i want for each form 4 tile that in qml are 4 rectangles
  }; Q_DECLARE_METATYPE(Form)
  
  
  
  class FormModel : public QAbstractListModel
  {
      Q_OBJECT
  public:
      explicit FormModel(QObject *parent = 0);
  
      ~FormModel();
      enum dashBoardRoles {
  
          NameForm=Qt::UserRole+1,
          Grid,
  
       };
  
      int rowCount(const QModelIndex &amp;parent=QModelIndex()) const;
      QVariant data(const QModelIndex &amp;index, int role) const;
      Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &amp;parent = QModelIndex()) Q_DECL_OVERRIDE;
      Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &amp;parent = QModelIndex()) Q_DECL_OVERRIDE;
      QHash&lt;int, QByteArray&gt; roleNames() const;
  
  signals:
  
  public slots:
  
  private:
  
    QList&lt;Form&gt; dashboard;
  
  
  };
  </code></pre>
  
  <p>This is data method of QAbstractListModel:</p>
  
  <pre><code>QVariant FormModel::data(const QModelIndex &amp;index, int role) const
  {
      if(index.row()&gt;0 &amp;&amp; index.row() &gt;= dashboard.count())
          return QVariant();
      Form dashTemp = dashboard[index.row()];
  
      if(role== NameForm)
          return dashTemp.nameForm;
      if(role== Grid)
      {
          QVariant gridVect = QVariant::fromValue(dashTemp.grid);
          return gridVect;
      }
      return QVariant();
  }
  
  QHash&lt;int, QByteArray&gt; FormModel::roleNames() const
  {
      QHash &lt;int,QByteArray&gt; roles;
      roles [NameForm]="nameForm";
      roles [Grid]="grid";
  
      return roles;
  }
  </code></pre>
  
  <p>this is the qml code:</p>
  
  <pre><code>Window {
      id:app
      visible: true
      width: 480
      height: 800
      title: qsTr("Hello World")
  
      ListView {
  
       model: myForms  // i have defined the name in main.cpp
       anchors.fill: parent
  
       delegate:  ColumnLayout{
            spacing: 30
            // nome Form
            Text{
  
                text: nameForm
                font.pointSize:20
                color: "red"
                font.capitalization: Font.Capitalize
  
            }
            // grigla mattonelle
            GridView {
                id:grid
  
                width: 300; height: 300
                cellWidth: 100 ; cellHeight: 100
                model: 9
                delegate: Item{
                    width : grid.cellWidth
                    height: grid.cellHeight
                    Rectangle{
                        anchors.centerIn: parent
                        width:parent.width-10
                        height: parent.height-10
                        color: grid[index].color
                    }
  
                }
           }
         }
      }
  
  }
  </code></pre>
  
  <p>How i can get the color from the data of role Grid? that in qml i call with grid[index].color....</p>