Change base dir for stylesheet urls
-
Hi,
Is it possible to change the base directory for the paths in the stylesheets?
Maybe I am looking at it the wrong way. The Problem is that (on Linux) we use the ./config folder for our appimage's additional files. It seems like the stylesheets can't find the relative paths set in there (for example a background.png or some font).Thx, Megamouse
-
@Megamouse
IIRC the current dir is used for loading. So if possible you could callQDir::setCurrent()
before applying the stylesheet. -
I just noticed that this might not be what I was looking for after all.
Doesn't QDir::setCurrent set the working directory for the entire process?
I don't really want that... I only want it for the stylesheet.
And if I reset the working dir after setStylesheet it won't work anymore if I open a new Dialog afterwards for example. -
Hi,
In that case what you can do is to have a stylesheet which contains a placeholder for the path "prefix". Use QString::arg to replace that placeholder with required value when applying the stylesheet.