I’m trying to load an external QML file dynamically. The following code works when I use a FileDialog to resolve the path:
var Url = fileDialog.fileUrl;
console.log(Url.toString()); // qml: file:///C:/Templates/benchmark.qml
templateLoader.source = Url;
But when I try to assign the source using a string, I get a “File not found” error:
var sUrl = "file:///C:/Templates/benchmark.qml";
templateLoader.source = sUrl;
This seems to be related to the problem in this discussion: http://qt-project.org/forums/viewthread/19528 but when I try the binding trick it doesn’t work. What am I doing wrong?
↧