title: Iterating over a QVariant that is a QList<int>?
body: <p>I'm using QObject's dynamic property to store information to be used in a Slot that can access said property. The sender is a QState with: <code>myQState-&gt;setProperty("key", QList&lt;int&gt;(0, 1, 2));</code></p>
  
  <p>I would like to convert the stored <a href="http://qt-project.org/doc/qt-4.8/qvariant.html" rel="nofollow">QVariant</a> back to a QList so it can be iterated. The following code does not work (error C2440: QVariant can't be converted to QList with {[T=int]):</p>
  
  <pre><code>QVariant vprop = obj-&gt;property("key");
  QList&lt;int&gt; list = vprop; //   &lt; - - - - - - - - ERROR
  foreach (int e, list )
  {
      qDebug() &lt;&lt; __FUNCTION__ &lt;&lt; "" &lt;&lt; e;
  }
  </code></pre>
  
  <hr>
  
  <p>This code works. The object to set as property:</p>
  
  <pre><code>QVariantList list;
  list.append(0);
  list.append(1);
  list.append(2);
  </code></pre>
  
  <p>And in the slot</p>
  
  <pre><code>QObject *obj = this-&gt;sender();
  foreach( QByteArray dpn, obj-&gt;dynamicPropertyNames() )
  {
      qDebug() &lt;&lt; __FUNCTION__ &lt;&lt; "" &lt;&lt; dpn;
  }
  QVariant vprop = obj-&gt;property("key");
  qDebug() &lt;&lt; __FUNCTION__ &lt;&lt; "" &lt;&lt; vprop;
  QVariantList list = vprop.toList();
  foreach(QVariant e, list )
  {
      qDebug() &lt;&lt; __FUNCTION__ &lt;&lt; "" &lt;&lt; e.toInt();
  }
  </code></pre>