Qmllive debugging with embedded resources

I have two application where qml resources are not included using the ‘usual’ directory structures and includes:

In the one case, the resource is successfully initialized with

view->setSource(QUrl(“qrc:/src/gui/sailfishos/main.qml”));

but the application pane in the SDK shows:

[W] unknown:72 - qrc:/src/gui/sailfishos/pages/MainPage.qml:72:13: QML MenuItem: Binding loop detected for property “text”
[W] unknown:0 - Failed to determine initial active document: “No mapping exists for resource: ‘qrc:/src/gui/sailfishos/main.qml’”

I thought that maybe SailfishApp needs to know, but doubt this is the correct incantation:

view->setSource(SailfishApp::pathTo(QUrl(“qrc:/src/gui/sailfishos/main.qml”)));

I think, though, that the correct way is a mapping in the qrc file?

I’m hesitant to call this a bug since both cases are apps which where developed cross-platform.

1 Like

Hint: always link sources if they are available online :wink:

This is about https://github.com/poetaster/fahrplan I assume.

I don’t see an obvious issue there, except maybe the fact that there are various QRC files for various platforms but QML Live processess all equally, so it may get lost among all the alternatives. Try enabling the debug output by adding QT_LOGGING_RULES=QmlLive.ResourceMap.debug=true to run environment – this should give you a clue. The corresponding source is here https://github.com/sailfishos/qmllive/blob/master/src/resourcemap.cpp.

Sorry, yes fahrplan, but also machines vs. machines.

The ResourceMap for Sailfish, as specified in the pro is handled correctly, it seems:

[D] unknown:0 - Updating resource map for “sailfishos_res.qrc”
[D] unknown:0 - Mapping “C/://src/gui/sailfishos/Cover.qml” to “src/gui/sailfishos/Cover.qml”
[D] unknown:0 - Mapping “C/://src/gui/sailfishos/main.qml” to “src/gui/sailfishos/main.qml”
[D] unknown:0 - Mapping “C/://src/gui/sailfishos/pages/MainPage.qml” to “src/gui/sailfishos/pages/MainPage.qml”

etc. Results in:

[W] unknown:0 - Failed to determine initial active document: “No mapping exists for resource: ‘qrc:/src/gui/sailfishos/main.qml’”

Is this perhaps a leading slash issue? The qrc has:

 <RCC>
     <qresource prefix="/">
         <file>src/gui/sailfishos/Cover.qml</file>
         <file>src/gui/sailfishos/main.qml</file>