title: How to use QT signals and slots in QGIS C++ API
body: <p>I'm developing a standalone QT 5.11.2 application using QGIS 3.6 C++ API.</p>
  
  <p>I have defined a slot that is meant to consume a <code>currentLayerChanged(QgsMapLayer * layer)</code> signal.</p>
  
  <p>The slot declaration in the header file is:</p>
  
  <pre><code>private slots:
      void on_CurrentLayer_changed(QgsMapLayer *layer);
  </code></pre>
  
  <p>The slot definition is:</p>
  
  <pre><code>void MainWindow::on_CurrentLayer_changed(QgsMapLayer *  layer)
  {
      // do something here
  }
  </code></pre>
  
  <p>When I try to build I get a linker error:</p>
  
  <pre><code>moc_mainwindow.obj:-1: error: LNK2019: símbolo externo "public: static struct QMetaObject const QgsMapLayer::staticMetaObject" (?staticMetaObject@QgsMapLayer@@2UQMetaObject@@B) sin resolver al que se hace referencia en la función "int __cdecl qRegisterMetaType&lt;class QgsMapLayer *&gt;(char const *,class QgsMapLayer * *,enum QtPrivate::MetaTypeDefinedHelper&lt;class QgsMapLayer *,1&gt;::DefinedType)" (??$qRegisterMetaType@PEAVQgsMapLayer@@@@YAHPEBDPEAPEAVQgsMapLayer@@W4DefinedType@?$MetaTypeDefinedHelper@PEAVQgsMapLayer@@$00@QtPrivate@@@Z)
  File not found: moc_mainwindow.obj
  error: LNK1120: 1 externos sin resolver
  </code></pre>
  
  <p>Should I subclass any of the classes that emit the signal  <code>currentLayerChanged(QgsMapLayer * layer)</code> to define the slot?</p>