title: I got errors: "QQmlApplicationEngine failed to load component" and "qrc:/main.qml:-1 File not found"
body: <p>I created a Qt Widgets application, then added a qml named "<em>main.qml</em>" to it. My files are <em>dialog.cpp</em>, <em>dialog.h</em>, <em>dialog.ui</em>, <em>main.cpp</em>, <em>untitiled9.pro</em>, <em>main.qml</em> in <em>qml.qrc</em> </p>
  
  <p><em>main.cpp</em>:</p>
  
  <pre><code>#include "dialog.h"
  #include &lt;QApplication&gt;
  #include &lt;QQmlApplicationEngine&gt;
  #include&lt;QtQml&gt;
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      Dialog w;
      // w.show();
      QQmlApplicationEngine engine;
      // engine.load(QUrl(QStringLiteral("qrc://main.qml")));
      engine.load(QUrl::fromLocalFile("qrc:///main.qml"));
      return a.exec();
  }
  </code></pre>
  
  <p>I wrote <code>QT += qml quick widgets</code> in <em>untitled9.pro</em>.<br>
  I didn't modified other codes, how did this happen?
  This is my first question in stackoverflow, I try to make my question clear. </p>