title: Qt - Q_DECLARE_METATYPE() with an enum class type
body: <p>Is there a way to use Q_DECLARE_METATYPE() with enum class types? I know old enums work but what about these new, strongly typed, ones? Can't find anything regarding this problem elsewhere. I'm using the latest Qt version available.</p>
  
  <p>Example:</p>
  
  <pre><code>enum Foo
  {
      A,
      B,
      C
  };
  
  Q_DECLARE_METATYPE(Foo)
  QVariant var = Foo::A; // works fine
  
  enum class Bar
  {
      X,
      Y,
      Z
  };
  
  Q_DECLARE_METATYPE(Bar)
  QVariant var = Bar::X; // doesn't compile
  </code></pre>