Hi,
With Qt 4.8, I used to rely on the @import statement to import a CSS file into another, but for some (very annoying) reason it doesn't work anymore in Qt 5 (see http://www.qtcentre.org/threads/5279...orts-in-QtHelp). So, I thought I would do things differently, but now I am facing another unrelated issue.
Basically, my application's help is made of a series of HTML files which are styled using CSS. Those HTML files are used both on my application's website and within my application. In some HTML files, I have some code which I have styled in a certain way, the idea being not to show that code on my application's website while showing it within my application.
For this, I have a very simple CSS rule [1]:
span.myapp {
display: none;
}
span.myapp {
display: none;
}
To copy to clipboard, switch view to plain text mode
So, this means that by default (i.e. on my application's website), the code is not shown. Now, in my application, I want to see the code, so I thought I would use something like:
myWebView
->page
()->settings
()->setUserStyleSheetUrl
(QUrl::fromLocalFile(myLocalCssFile
));
myWebView->page()->settings()->setUserStyleSheetUrl(QUrl::fromLocalFile(myLocalCssFile));
To copy to clipboard, switch view to plain text mode
myLocalCssFile points to a file which has the following contents [2]:
span.myapp {
display: inline;
}
span.myapp {
display: inline;
}
To copy to clipboard, switch view to plain text mode
So, yes, some very simple code to show the code within my application. Yet, it doesn't work!
Interestingly (so to speak!), if I completely remove [1] and replace [2] with:
span.myapp {
color: rgb(255, 0, 0);
}
span.myapp {
color: rgb(255, 0, 0);
}
To copy to clipboard, switch view to plain text mode
Then, the code will be shown in all cases, except that within my application it will be in red.
So... it would seem that for (yet) some (more very annoying) reason, something is broken in Qt 5... or have I done something wrong. Hopefully, it's the latter...
Anyway, anyone any idea?
Cheers, Alan.
Bookmarks