Skip to content

Problems when the qml files are located in a .qrc file #53

@Zicandar

Description

@Zicandar

If the .qml file(s) are located in a qt resource file, then it seems that any relative path set in the qml will be automatically translated into a relative path inside the qrc. However the code is checking that the file is a local file, before attempting to load it, and because it is inside a qrc file, it will ignore it.
I was not getting any error message in the output from this, and while I have hacked a solution that solves it locally for us: (same thing done for the default stylesheet source).
void StyleEngineSetup::setStyleSheetSource(const QUrl& url) { QUrl modifiedUrl = url.adjusted(QUrl::RemoveScheme); modifiedUrl = modifiedUrl.fileName(); modifiedUrl.setScheme("file");
The modifiedUrl is then used in place of "url" in the functions.
However this hack itself has some obvious issues, such as only keeping the filename, and no path. (Note that our qml files were in a subdirectory "inside" the qml file, making it trickier.
For us this should work fine, so there is no hurry from us to solve it.

Cheers,
Zicandar
p.s. This plugin is amazing so far! Good work and thanks for sharing it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions