title: Properly reloading a QQmlApplicationEngine
body: <p>I have a QML-based app that loads a <code>main.qml</code> file from the file system like this:</p>
  
  <pre><code>myEngine-&gt;load("main.qml");
  </code></pre>
  
  <p>This works fine, but I'd like to "reload" the engine in case the main.qml was replaced with a newer version.</p>
  
  <p>What I tried so far was calling <code>load()</code> again, assuming that the engine will automatically reset itself like in other Qt classes.</p>
  
  <p>Unfortunately this is not the case. If I call the method again, another window will appear with the contents of the updated qml file, while the original window stays open and continues to display the old qml file.</p>
  
  <p>To fix this I tried to call <code>load(QUrl())</code>, followed by <code>clearComponentCache()</code> and a final load call for the new file. This results in the same effect.</p>
  
  <p>Any ideas how I can "properly" reload a QML engine while the application is running?</p>