title: Converting Qt 4.8 to 5 QPluginLoader->instance returns null
body: <p>I’ve written an Application by using QT 4.8.2. It does dynamically load different plugins to provide multiple functions for the user.
  Now Qt5 was released and I wanted to convert my project to the newest version.</p>
  
  <p>I got everything to work, except loading the plugin with QPluginLoader->instance(). While using Qt 4.8.2 it worked fine.</p>
  
  <p>->errorString says:
  “The file ‘…/plugins/nlprod.dll’ is not a valid Qt plugin.”</p>
  
  <p>That’s my code:</p>
  
  <p>PluginLoader.cpp:</p>
  
  <pre><code>//"fileName" contains the name of the .dll
  pluginLoader-&gt;setFileName(pluginsDir-&gt;absoluteFilePath(fileName));
  
  //"a" contains the correct path + name of the .dll
  QString a = pluginLoader-&gt;fileName();      
  
  //"plugin" is null and success "false"
  QObject *plugin = pluginLoader-&gt;instance();
  bool success = pluginLoader-&gt;isLoaded();
  </code></pre>
  
  <p>MyPlugin.h:</p>
  
  <pre><code>class NLPro : public QObject, IConnection
  {
      Q_OBJECT
      Q_PLUGIN_METADATA(IID "NLPro" FILE "nlpro.json") // &lt;- New since I've ported to Qt 5
      Q_INTERFACES(IConnection)
  ...
  }
  </code></pre>
  
  <p>MyPlugin.cpp:
  I’ve deleted the following:</p>
  
  <pre><code>Q_EXPORT_PLUGIN2(NLPro, NLPro);
  </code></pre>
  
  <p>and I’ve added a .json-file with the following content:</p>
  
  <pre><code>{ "Keys": [ "NLPro"] }
  </code></pre>