[PySide] QLabel vs QWebView for simple html display

Gargi Das gargi.das at hotmail.com
Tue Nov 12 08:25:05 CET 2013


Hi,

If html is that much simple why dont you parse the html and extract the url, but than you have to download the image and make a proper model for your listview.

Other solution is to apply some css to the webview and make it look like label i think that can be done !!

Regards,
Gargi
________________________________
From: Frank Rueter | OHUfx<mailto:frank at ohufx.com>
Sent: ‎12-‎11-‎2013 09:57 AM
To: pyside at qt-project.org<mailto:pyside at qt-project.org>
Subject: [PySide] QLabel vs QWebView for simple html display

Hi all,

I have a QLabel in my app that displays some very simple html code
pulled from a website.

So far I have been using it successfully as a sort of news feed, but now
I need to display an image from a url as well, which QLabel can't do afaik.

So I had a go with QWebView but that just won't be have the same as
QLabel when it comes to background colour (tried to set it to be
transparent), sizes, size policies etc.
I'm also getting some redraw problems when the QWebView is set to a
transparent background.

Here is some test code:
http://pastebin.com/cSizj9ET


Is it the right approach to force QWebView to behave like QLabel for the
sole reason of being able to display an image via html? Or is there a
simpler way of doing this?


Cheers,
frank
_______________________________________________
PySide mailing list
PySide at qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20131112/29d34224/attachment.html>


More information about the PySide mailing list