Qt 5: handling of CSS imports in QtHelp
Note: this is a reposting of my original post in the Qt Programming sub-forum. I wasn't aware of this WebKit sub-forum...
---------------------------------------
Hi,
I use QtHelp for my application’s help. It’s all very simple HTML and CSS code. In my help’s home page, I link a CSS file as follows:
Qt Code: Switch view
Code:
<link href="res/stylesheet.css" rel="stylesheet" type="text/css"/>
To copy to clipboard, switch view to plain text mode
Then, in my res/stylesheet.css file, I import another CSS file as follows:
Qt Code: Switch view
Code:
@import "/doc/res/common.css";
To copy to clipboard, switch view to plain text mode
/doc is the root folder for my application’s help and it’s how QtHelp (in Qt 4.8) used to require the import to be done (see this previous thread of mine).
However, now, the above @import statement just doesn’t work, meaning that my application’s help doesn’t get styled anymore.
So, was I doing the right thing before and/or have things changed in Qt 5? What is certain is that if I include my CSS code directly in res/stylesheet.css, then everything is fine, telling me that the issue is with @import…
Anyway, any help would be much appreciated…
Cheers, Alan.
Re: Qt 5: handling of CSS imports in QtHelp
I was rather thinking about a forum at webkit.org when I suggested posting at a webkit forum :)
Re: Qt 5: handling of CSS imports in QtHelp
I must confess that it did cross my mind... :) This being said, I was wondering whether the problem wasn't, somehow, related to Qt 5 rather than WebKit itself. Still, I am also going to check on the WebKit forum...
Re: Qt 5: handling of CSS imports in QtHelp
FWIW, I just came back to the above issue and found out what happened. Basically, the syntax changed (?) between Qt 4 and Qt 5. So, rather than having something like:
Code:
@import "/doc/res/common.css";
We should now have:
Code:
@import "qthelp://namespace/virtualFolder/doc/res/common.css";
Now, I wish it had been documented somewhere...