title: Qt create component from relative URL
body: <p>In <a href="http://qt-project.org/doc/qt-4.8/qdeclarativedynamicobjects.html#creating-a-component-dynamically" rel="nofollow">the 4.8 docs</a>, it is specified that:</p>
  
  <blockquote>
    <p>When using files with relative paths, the path should be relative to the file whereQt.createComponent() is executed.</p>
  </blockquote>
  
  <p>So I use the following to create an object:</p>
  
  <pre><code>Qt.createComponent("./foo/bar.qml").createObject(_this)
  </code></pre>
  
  <p>But I get the error:</p>
  
  <blockquote>
    <p>QQmlComponent: Component is not ready</p>
  </blockquote>
  
  <p>I have also tried (without luck) <code>"foo/bar.qml"</code>. Changing to <code>"foobar.qml"</code> works fine, with the directory structure:</p>
  
  <pre><code>./
   +--foo/
   |     `--bar.qml
   `--foobar.qml
  </code></pre>
  
  <p>I notice however that there is no mention of relative URLs in <a href="http://qt-project.org/doc/qt-5/qml-qtqml-component.html#createObject-method" rel="nofollow">the version 5 docs</a>, so is there a new way to do this that I'm missing?</p>