Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Zicandar opened this issue Mar 22, 2017 · 0 comments
Open

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

Zicandar opened this issue Mar 22, 2017 · 0 comments

Comments

@Zicandar
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant