title: Qt and plugin loading confusion
body: <p>We have a (quite big) application which:</p>
  
  <ol>
  <li>uses QML as its interface, one of the applications' window uses QML components stored in QML components providing plugins (call it config plugin)</li>
  <li>has several other plugins that are loaded dynamically via <code>QPluginLoader</code>. </li>
  </ol>
  
  <p>One of these other plugins is also having a QML interface which also needs the QMLs provided from the QML component providing config plugin.</p>
  
  <p>The main problem is the following:</p>
  
  <ol>
  <li><p>if we load the other plugin which "theoretically" will initialize the QML providing plugin (by calling <code>registerTypes</code> which does all the <code>qmlRegisterType</code> calls), the QML from the plugin is accessible from the other plugins' interface, but not from our applications' interface (meaning: when we create the window in the main app using the QML from the plugin nothing is visible, but we see from the logs (console.log) that all the components were created normally)</p></li>
  <li><p>if we hack into the system, and call from the main app directly the <code>registerTypes</code> of the QML providing plugin then the main applications' QML interface shows the config components from the config QML providing plugin, however the other plugin does not load, with a complaint like:</p></li>
  </ol>
  
  <p><code>Plugin loader error: "Failed to initialised plugin /usr/lib/vcs-gui/plugins/libother.so: qrc:///wbmshi-gui/SettingsBrowser.qml:2:1: plugin cannot be loaded for module \"conftree\": Namespace 'conftree' has already been used for type registration"</code></p>
  
  <p>(where conftree is the actual name of the config plugin)</p>
  
  <p>To make things more obscure, this behaviour started when we have switched from the old <code>qmake</code> based build system to <code>cmake</code>. Possibly we did not manage to recreate some of qmake's black magic tricks.</p>
  
  <p>Any suggestion is most welcome in dealing with this situation.</p>