title: How to pass QList from QML to C++/Qt?
body: <p>I'm trying to pass <code>QList</code> of integer from QML to C++ code, but somehow my approach is not working. With below approach am getting following error:</p>
  
  <pre><code>left of '-&gt;setParentItem' must point to class/struct/union/generic type
  type is 'int *'
  </code></pre>
  
  <p>Any inputs to trouble shoot the issue is highly appreciated</p>
  
  <p>Below is my code snippet</p>
  
  <p><strong>Header file</strong></p>
  
  <pre><code>Q_PROPERTY(QDeclarativeListProperty&lt;int&gt; enableKey READ enableKey) 
  
  QDeclarativeListProperty&lt;int&gt; enableKey(); //function declaration
  QList&lt;int&gt; m_enableKeys;
  </code></pre>
  
  <p><strong>cpp file</strong></p>
  
  <pre><code>QDeclarativeListProperty&lt;int&gt; KeyboardContainer::enableKey()
  {
      return QDeclarativeListProperty&lt;int&gt;(this, 0, &amp;KeyboardContainer::append_list);
  }
  
  void KeyboardContainer::append_list(QDeclarativeListProperty&lt;int&gt; *list, int *key)
  {
      int *ptrKey = qobject_cast&lt;int *&gt;(list-&gt;object);
      if (ptrKey) {
          key-&gt;setParentItem(ptrKey);
          ptrKey-&gt;m_enableKeys.append(key);
      }
  }
  </code></pre>