[Interest] QWebView and Joomla pages
Frank Rueter | OHUfx
frank at ohufx.com
Sun Jan 15 02:22:34 CET 2017
Hi Kai,
my apologies for not replying earlier!
Thank you for the explanation, so it sounds like its "should just work".
After reading your explanation I realised that the html I am feeding
into the WebView comes directly from a data base query and does not
include the headers you see in the source of the web page.
So I suppose if I find the right CSS files and add the respective lines
back to the downloaded html before feeding it into WebView via setHtml
it should work?!
e.g.:
cssHeaders = '<head><link rel="stylesheet"
href="/templates/yoo_sync/base.css" /></head>'
webView.setHtml(cssHeaders + html)
Those particular css files don't give me what I'm aft so I need to dig
up the correct one, but should this work?
Cheers,
frank
On 12/01/17 11:29 PM, Kai Koehne wrote:
>> -----Original Message-----
>> From: Frank Rueter | OHUfx [mailto:frank at ohufx.com]
>> Sent: Thursday, January 12, 2017 9:05 AM
>> To: Kai Koehne <Kai.Koehne at qt.io>; interest at qt-project.org
>> Subject: Re: [Interest] QWebView and Joomla pages
>>
>> Thanks Kai,
>>
>> thanks for the quick reply!
>> I'd be quite happy to read the CSS files from the server rather than injecting
>> locally, but I know little about CSS and the website has a whole bunch that all
>> happily cross import things.
> Hi Frank,
>
> Usually the setup is that the CMS links to the CSS from the HTML. That is, the page
> Delivered to the web browser contains lines like
>
> <link rel="stylesheet" href="/components/com_jcomments/tpl/default/style.css?v=21" type="text/css" />
> <link rel="stylesheet" href="/cache/template/gzip.php?widgetkit-e2f1f3d7-9b14bd45.css" type="text/css" />
>
> This is actually from view-source:http://www.nukepedia.com/gizmos/filter/efibonacciglow. The web browser will then automatically try to download and apply e.g. http://www.nukepedia.com/components/com_jcomments/tpl/default/style.css?v=21 .
>
> I understand that either your CMS is configured wrong, and doesn't include these links, or that you hit a bug in WebEngine where the css for a reason or the other is not fetched, or applied correctly. Can you clarify??
>
>> I have attached the css folder from the website as that will tell you more than
>> my ramblings
>>
>> If it's possible to simply point QWebView to that online folder and make
>> sense of it on the fly, I would be perfectly happy.
> See above - it is something that the .html page itself should link to. The QWebEngineSettings::setUserStyleSheetUrl you found is only a fallback, e.g. if you want to tweak the layout of pages you don't have any control over on the server side.
>
>> Otherwise I guess I will have to figure out how to merge all these things into
>> a master css.
> As I mentioned already, you can also link from a CSS to another CSS by using the @import rule .
>
> Regards
>
> Kai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170115/363d6658/attachment.html>
More information about the Interest
mailing list