QML allows us to structure our apps very well into Modules and then import them whenever needed into our application. This makes sense, especially since we just have to work with namespaces and not with URIs / paths.
However when I want to create a QML Component dynamically, I can only load it from a URI / path. For example:
var myComponent = Qt.createComponent("./qml/Button/Button.qml");
To me, this seems to contradict very much with Qt / QML's philosophy of working with Namespaces instead of URIs / paths.
Why is it not possible to do the following:
import QtQuick 2.4
import com.MyCustomStuff 1.0 // <-- contains my custom Button
...
function createMyObj(){
return Qt.createComponent(Button);
}
I would very much appreciate any explanation from our Qt Experts! Thanks!