title: QVariant with custom class pointer does not return same address
body: <p>I need to assign a pointer to a custom class in qml using <code>QQmlContext::setContextProperty()</code>. Another qml object has <code>Q_PROPERTY</code> of the same type to retrieve it again.</p>
  
  <p>A simple test showed me that the conversion does not work like i thought.</p>
  
  <pre><code>#include &lt;QCoreApplication&gt;
  #include &lt;QDebug&gt;
  #include &lt;QMetaType&gt;
  
  class TestClass
  {
  public: TestClass() { qDebug() &lt;&lt; "TestClass()::TestClass()"; }
  };
  
  Q_DECLARE_METATYPE(TestClass*)
  
  int main(int argc, char *argv[])
  {
      QCoreApplication app(argc, argv);
  
      qDebug() &lt;&lt; "metaTypeId =" &lt;&lt; qMetaTypeId&lt;TestClass*&gt;();
  
      auto testObject = new TestClass;
      QVariant variant(qMetaTypeId&lt;TestClass*&gt;(), testObject);
      auto test = variant.value&lt;TestClass*&gt;();
  
      qDebug() &lt;&lt; testObject &lt;&lt; variant &lt;&lt; test;
  
      return 0;
  }
  </code></pre>
  
  <p>This tiny test application gives me an output like this:</p>
  
  <pre><code>metaTypeId = 1024
  TestClass::TestClass()
  0x1b801e0 QVariant(TestClass*, ) 0x0
  </code></pre>
  
  <p>I would really like to get the same pointer out again after converting it down to a <code>QVariant</code>. Later I will assign it to a qml context and then the conversation must work correctly.</p>