title: why q_enum unable to get correct type value without qRegisterMetaType?
body: <p>I have a QT project with several dlls.</p>
  
  <p>Dlls:  A, B, C</p>
  
  <p>A depends on B and C. While B and C doesn't have any dependencies. </p>
  
  <p>B exports custom class B_Custom.  Class B_Custom is derived from QObject.</p>
  
  <p>Dll A:</p>
  
  <pre><code>Class Exported A : public C
  {
      ...
      Q_PROPERTY(B_Custom:B_Enum b_enum READ GetBEnum WRITE SetBEnum NOTIFY BEnumChanged);
  
      void DoSomething()
      {
          SomethingElse("b_enum");
      }
  
      ....
  }
  </code></pre>
  
  <p>Dll B:</p>
  
  <pre><code>class Exported B_Custom: public QObject
  {
      Q_OBJECT;
      public:
          enum B_Enum {
              ...
          };
          Q_ENUM(B_Enum);
      ...
  }
  </code></pre>
  
  <p>Dll C:</p>
  
  <pre><code>Class C : public QObject
  {
      virtual void SomethingElse(const QByteArray &amp;propName)
      {
          auto type = property(propName).userType();
      }
  }    
  </code></pre>
  
  <p>In main:</p>
  
  <pre><code>A * a = new A();
  a-&gt;DoSomething();
  </code></pre>
  
  <p>The problem is for Class C, the type value of function SomethingElse is QMetaType::UnknownType.</p>
  
  <p>But if I manually register the B_Enum in Dll B with </p>
  
  <pre><code>qRegisterMetaType&lt;B_Custom::B_Enum&gt;() 
  </code></pre>
  
  <p>before call A::DoSomething(), 
  the type value of function SomethingElse will not be QMetaType::UnknownType. </p>
  
  <p>It will return correct type value like 1230 for type in function SomethingElse of class C.</p>
  
  <p>But accroding to QT document @<a href="http://doc.qt.io/qt-5/qobject.html#Q_ENUM" rel="nofollow noreferrer">http://doc.qt.io/qt-5/qobject.html#Q_ENUM</a>, </p>
  
  <p>Enumerations that are declared with Q_ENUM have their QMetaEnum registered in the enclosing QMetaObject. 
  You can also use QMetaEnum::fromType() to get the QMetaEnum.</p>
  
  <p>Registered enumerations are automatically registered also to the Qt meta type system, making them known to QMetaType without the need to use Q_DECLARE_METATYPE(). </p>
  
  <p>So why I need to call qRegisterMetaType() in order to let type in SomethingElse function of Class C get correct type value?</p>
  
  <p>There are quit a lot similar types in dll B and need to get type information in class C.</p>
  
  <p>If I need to use qRegisterMetaType to register these types one by one, its really not a pleasure. </p>