title: QVariant to QObject*
body: <p>I'm trying to attach a pointer to an <code>QListWidgetItem</code>, to be used in the slot <code>itemActivated</code>.</p>
  
  <p>The pointer I'm trying to attach is a <code>QObject*</code> descendant, so, my code is something like this:</p>
  
  <pre><code>Image * im = new Image();  
  // here I add data to my Image object
  // now I create my item
  QListWidgetItem * lst1 = new QListWidgetItem(*icon, serie-&gt;getSeriesInstanceUID(),  m_iconView);
  // then I set my instance to a QVariant
  QVariant v(QMetaType::QObjectStar, &amp;im)
  // now I "attach" the variant to the item.
  lst1-&gt;setData(Qt::UserRole, v);
  //After this, I connect the SIGNAL and SLOT
  ...
  </code></pre>
  
  <p>Now my problem, the <code>itemActivated</code> slot. Here I need to extract my <code>Image*</code> from the variant, and I don't know how to.</p>
  
  <p>I tried this, but I get the error:</p>
  
  <blockquote>
    <p>‘qt_metatype_id’ is not a member of ‘QMetaTypeId’</p>
  </blockquote>
  
  <pre><code>void MainWindow::itemActivated( QListWidgetItem * item )
  {
      Image * im = item-&gt;data(Qt::UserRole).value&lt;Image *&gt;();
      qDebug( im-&gt;getImage().toAscii() );
  }
  </code></pre>
  
  <p>Any hint?</p>
  
  <pre><code>Image * im = item-&gt;data(Qt::UserRole).value&lt;Image *&gt;();
  </code></pre>