title: qmlRegisterSingletonType and multiple top-level windows
body: <p>I have a <code>QGuiAppplication</code> derived class (called <code>Sy_application</code>) that I've wrapped with another (called <code>Sy_application_qml</code>, with extra some QML specific features) and then registered that as a singleton with the QML engine.</p>
  
  <p>This all works fine from the first opened top-level window, but the second (and presumably any more) only gets <code>null</code> from the singleton.  Adding some debug:</p>
  
  <pre><code>// The static factory method used in the qmlRegisterSingletonType call.
  QObject* Sy_application_qml::factory( QQmlEngine* engine,
                                        QJSEngine* scriptEngine )
  {
      Q_UNUSED( engine )
      Q_UNUSED( scriptEngine )
  
      qDebug() &lt;&lt; "Creating";
      return new Sy_application_qml();
  }
  
  // SY_APP is the qApp macro casted to my Sy_application type.
  QObject* Sy_application_qml::get()
  {
      qDebug() &lt;&lt; "Getting:" &lt;&lt; SY_APP;
      return SY_APP;
  }
  
  // This is an example of it's use within QML
  onPositiveClicked: {
      console.log( Sy_application_qml );
      Sy_application_qml.get().newProject( sampleRate.value, frameRate.value );
      close();
  }
  </code></pre>
  
  <p>And the debug output:</p>
  
  <pre><code>// Opening first window.
  Creating
  
  // Creating second
  qml: Sy_application_qml(0x1895b30)
  Getting: Sy_application(0x7fff80f051c0)
  
  // Attempting to create third
  qml: Sy_application_qml(0x1895b30)
  Getting: Sy_application(0x7fff80f051c0)
  qrc:/qml/gui/dialogs/Sy_newProjectDialog.qml:62: TypeError: Cannot call method 'newProject' of null
  </code></pre>
  
  <p>As you can see the singleton is still present and the C++ <code>Sy_application</code> instance is being returned correctly, but is appearing as <code>null</code> on the QML side.  Any reason why it works for one window and not another?</p>