title: How can I cast a QVariant to custom class?
body: <p>I'm developing a BlackBerry 10 mobile application using the Momentics IDE (native SDK).</p>
  
  <p>I have a listview which I want to handle its items click with C++ (I need to use C++ not QML).</p>
  
  <p>I can get the index path using the "connect" instruction, but I have problem with parsing a QVariant to a custom class ;</p>
  
  <pre><code>Q_ASSERT(QObject::connect(list1, SIGNAL(triggered(QVariantList)), this, SLOT(openSheet(QVariantList))));
  
  QVariant selectItem = m_categoriesListDataModel-&gt;data(indexPath);
  </code></pre>
  
  <p>I tried to use the static cast like below </p>
  
  <pre><code>Category* custType = static_cast&lt;Category*&gt;(selectItem);
  </code></pre>
  
  <p>but it returns :</p>
  
  <pre><code>"invalid static_cast from type 'QVariant' to type 'Category*'"
  </code></pre>
  
  <p>Can anyone help me on this ?</p>