title: Qt5.11 app plugins build error occurs: Signal and slot arguments are not compatible
body: <p>I want to develop an <strong>plugin-based Qt application</strong>.</p>
  
  <p>As one part of the app, plugins should be able to add toolbars or widgets to app's MainWindow.
  I think the toolbar of plugins should be created within plugin's implementation and passed to MainWindow. </p>
  
  <p><a href="https://stackoverflow.com/questions/34312928/qt-object-management-with-qt-plugins">Refer this link:Qt object management with Qt Plugins</a> I write my code.
  I use an <code>on_Action_triggered()</code>(function no param) as slot to receive the signal of toolbar action <code>triggered()</code>, then connect the action<code>addShapeAction</code> to<code>on_Action_triggered()</code> ,using:</p>
  
  <pre><code>connect(addShapeAction,SIGNAL(triggered(bool)),this,SLOT(on_Action_triggered()))
  </code></pre>
  
  <p>But I got some errors when building the code.
  <a href="https://i.stack.imgur.com/3bP3c.png" rel="nofollow noreferrer">enter image description here</a>
  such as: </p>
  
  <pre><code>C:\Qt\Qt5.10.1\5.10.1\msvc2015\include\QtCore\qobject.h:320: error: C2338: Signal and slot arguments are not compatible.
  </code></pre>
  
  <p><strong>How to solve this problem?
  Is there any better way to build a toolbar of plugins?</strong></p>
  
  <p><strong>Here is the code of shapeplugininterface.h</strong></p>
  
  <pre><code>#ifndef SHAPEPLUGININTERFACE_H
  #define SHAPEPLUGININTERFACE_H
  
  #include &lt;QObject&gt;
  #include &lt;QString&gt;
  #include &lt;QtWidgets/QMainWindow&gt;
  class ShapePluginInterface{
  public:
      virtual ~ShapePluginInterface(){}
      virtual QString description() = 0;
      virtual void generateShape(QString shapeType) = 0;
      virtual void Initialize(QMainWindow* window);
  };
  #define SHAPEPLUGININTERFACE_IID "com.geolike.shapeplugininterface"
  Q_DECLARE_INTERFACE(ShapePluginInterface, SHAPEPLUGININTERFACE_IID)
  
  #endif // SHAPEPLUGININTERFACE_H
  </code></pre>
  
  <p><strong>And here is the code of basic_shape_plugin.h:</strong></p>
  
  <pre><code>#ifndef BASIC_SHAPE_PLUGIN_H
  #define BASIC_SHAPE_PLUGIN_H
  
  #include "basic_shape_plugin_global.h"
  #include "shapeplugininterface.h"
  #include &lt;QtPlugin&gt;
  #include &lt;QDebug&gt;
  #include &lt;QtWidgets/QAction&gt;
  #include &lt;QtWidgets/QToolBar&gt;
  
  class BASIC_SHAPE_PLUGINSHARED_EXPORT Basic_Shape_Plugin:
          public QObject,
          public ShapePluginInterface
  {
      Q_OBJECT
      Q_PLUGIN_METADATA(IID "com.geolike.shapeplugininterface")
      Q_INTERFACES(ShapePluginInterface)
  
  public:
      Basic_Shape_Plugin();
      ~Basic_Shape_Plugin();
      QString description();
      void generateShape(QString shapeType);
      void Initialize(QMainWindow* window);
  public slots:
      void on_Action_triggered();
  };
  #endif // BASIC_SHAPE_PLUGIN_H
  </code></pre>
  
  <p><strong>basic_shape_plugin.cpp files:</strong></p>
  
  <pre><code>#include "basic_shape_plugin.h"
  
  Basic_Shape_Plugin::Basic_Shape_Plugin(){}
  Basic_Shape_Plugin::~Basic_Shape_Plugin(){}
  
  QString Basic_Shape_Plugin::description()
  {
      return "This is a plugin to generate shapes.";
  }
  
  void Basic_Shape_Plugin::generateShape(QString shapeType)
  {
      qDebug() &lt;&lt; shapeType;
  }
  void Basic_Shape_Plugin::on_Action_triggered(){
      this-&gt;generateShape("Action Triggered!");
  }
  void Basic_Shape_Plugin::Initialize(QMainWindow *window)
  {
      QAction* addShapeAction = new QAction(window);
      connect(addShapeAction,SIGNAL(triggered(bool)),this,SLOT(on_Action_triggered()));
      QToolBar* toolBar = new QToolBar;
      toolBar-&gt;addAction("Shapes",addShapeAction);
      window-&gt;addToolBar(toolBar);
  }
  </code></pre>