title: Q_DECLARE_METATYPE doesn't work at all
body: <p>I'm trying to use custom classes in QAbstractListModel, and the Q_DECLARE_METATYPE doesn't work at all!</p>
  
  <p>To test where the problem is, I've simplified the code as the following:</p>
  
  <pre><code>#include &lt;QMetaType&gt;
  #include &lt;QVariant&gt;
  #include &lt;QDebug&gt;
  
  typedef int x;
  Q_DECLARE_METATYPE(x)
  
  void main() {
      QVariant v;
      qDebug() &lt;&lt; v.canConvert&lt;x&gt;();
  }
  </code></pre>
  
  <p>and the output is still false!</p>
  
  <p>btw, the code I want to implement is like:</p>
  
  <pre><code>namespace ns{
      class a {
          public:
              a();    //default constructor
              a(const a&amp;);    //copy constructor
              ~a();
      }
  }
  Q_DECALRE_METATYPE(ns::a);
  </code></pre>
  
  <p>and when I try to reimplement QAbstractListModel::data like this:</p>
  
  <pre><code>QList&lt;ns::s&gt; list;    //this is actually a member field of the custom model.
  QVariant MyListModel::data(const QModelIndex&amp; index, int role) const {      
      Q_UNUSED(role)
      return list.at(index.row());        
  }
  </code></pre>
  
  <p>the compiler will report and error like:</p>
  
  <pre><code>cannot convert const ns::a to QVariant::Type
  </code></pre>