title: QQuickImageProvider class error
body: <p>I wanted to migrate QPixmap from c ++ to qml.
  I created a class with the parent QQucikImageProvider</p>
  
  <pre><code>class test : public QQuickImageProvider
  {
  
  Q_OBJECT
  public:
      test():QQuickImageProvider(QQuickImageProvider::Pixmap)
      {
  
  }
  QPixmap requestPixmap(const QString &amp; id, QSize * size, const QSize &amp; requestedSize)
  {
      int width = 100;
      int height = 50;
  
      if (size)
          *size = QSize(width, height);
      QPixmap pixmap(requestedSize.width() &gt; 0 ? requestedSize.width() : width,
                     requestedSize.height() &gt; 0 ? requestedSize.height() : height);
      pixmap.fill(QColor(id).rgba());
  
      return pixmap;
  }
  
  };
  </code></pre>
  
  <p>And declared it in the main.cpp</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
  ...
  VK::test *imgProv = new VK::test();
  QQmlApplicationEngine engine;
  engine.addImageProvider("myprovider",imgProv);
  ...
  }
  </code></pre>
  
  <p>But at compilation I received the following errors:</p>
  
  <pre><code>moc_api.cpp:-1: error: undefined reference to `_imp___ZN19QQuickImageProvider11qt_metacastEPKc'
  
  moc_api.cpp:-1: error: undefined reference to `_imp___ZN19QQuickImageProvider11qt_metacallEN11QMetaObject4CallEiPPv'
  
  moc_api.cpp:-1: error: undefined reference to `_imp___ZN19QQuickImageProvider16staticMetaObjectE'
  </code></pre>