Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Cannot resolve local file url

$
0
0
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?

Viewing all articles
Browse latest Browse all 4972

Trending Articles