Re: [Interest] QWebView and Joomla pages

2017-01-14 Thread Frank Rueter | OHUfx
I go tit working now by adding the header data back into the downloaded 
html.

Thanks a lot Kai!

frank

On 15/01/17 2:22 PM, Frank Rueter | OHUfx wrote:

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 = 'href="/templates/yoo_sync/base.css" />'


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:fr...@ohufx.com]
Sent: Thursday, January 12, 2017 9:05 AM
To: Kai Koehne<kai.koe...@qt.io>;interest@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

   
   

This is actually 
fromview-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




___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QWebView and Joomla pages

2017-01-14 Thread Frank Rueter | OHUfx

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 = 'href="/templates/yoo_sync/base.css" />'


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:fr...@ohufx.com]
Sent: Thursday, January 12, 2017 9:05 AM
To: Kai Koehne <kai.koe...@qt.io>; interest@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

   
   

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


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QWebView and Joomla pages

2017-01-11 Thread Kai Koehne


> -Original Message-
> From: Interest [mailto:interest-bounces+kai.koehne=qt...@qt-project.org]
> On Behalf Of Frank Rueter | OHUfx
> Sent: Thursday, January 12, 2017 8:13 AM
> To: interest@qt-project.org
> Subject: [Interest] QWebView and Joomla pages
> 
> Hi all,

Hi,
 
> this may be a long shot but i don't quite know where else to get help:
> 
> I am trying to use QWebView to display a part of a Joomla page like this one.
> <http://www.nukepedia.com/gizmos/filter/efibonacciglow>
> Trouble is that I can't figure out how to deal with the required css files to
> ensure the widget looks like the browser.
>
> Trouble is Joomla is a CMS and there are a bunch of CSS files that are used 
> for
> any given page, and I don't know if QWebView can deal with that as well?

Are the CSS files served by the CMS (linked to from the HTML page), or do
You want to 'inject' them from the client side?

> Is it possible to make QWebView interpret a chain of CSS files that may all
> import other ones?

If the CSS files are delivered as part of the HTML page, then sure, this is
part of the standard. 

> E.g. could I somehow tell QWebView to load the CSS structures from the
> online page or do I have to provide  a single css and use it like this?
> 
> QWebView()settings().setUserStyleSheetUrl(QUrl.fromLocalFile(cssFile))
> 
> If the latter is the only way to get QT to utilise css information, then I 
> need to
> find a way to bake and merge those online css files to generate one that I can
> use with QT, but maybe QT is cleverer than that?

I see, so you're after injecting CSS locally, after all ... have you tried 
creating a master .css file that includes further .css files with the @import 
rule?

https://www.w3.org/TR/CSS21/cascade.html#at-import

Regards

Kai
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QWebView and Joomla pages

2017-01-11 Thread Frank Rueter | OHUfx

Hi all,

this may be a long shot but i don't quite know where else to get help:

I am trying to use QWebView to display a part of a Joomla page like this 
one. 
Trouble is that I can't figure out how to deal with the required css 
files to ensure the widget looks like the browser.
Trouble is Joomla is a CMS and there are a bunch of CSS files that are 
used for any given page, and I don't know if QWebView can deal with that 
as well?
Is it possible to make QWebView interpret a chain of CSS files that may 
all import other ones?
E.g. could I somehow tell QWebView to load the CSS structures from the 
online page or do I have to provide  a single css and use it like this?


QWebView()settings().setUserStyleSheetUrl(QUrl.fromLocalFile(cssFile))


If the latter is the only way to get QT to utilise css information, then 
I need to find a way to bake and merge those online css files to 
generate one that I can use with QT, but maybe QT is cleverer than that?


Any pointers would be great as I am truly stuck with this (web stuff is 
not my strong side).


Cheers,
frank

--
ohufxLogo 50x50  	*vfx compositing 
 | *workflow customisation 
and consulting * *


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest