Hello,
I'm desperate and after 2 weeks looking for I've come here. I think I have a similar problem with the setHtml function. However I'm programming with python and Plasma:
class crearWidgetApplet(plasmascript.Applet):
def __init__(self,parent,args=None):
plasmascript.Applet.__init__(self,parent)
def init(self):
self.setHasConfigurationInterface(False)
self.theme = Plasma.Svg(self)
self.theme.setImagePath("widgets/translucentbackground")
self.setBackgroundHints(Plasma.Applet.DefaultBackg round)
self.setAspectRatioMode(Plasma.IgnoreAspectRatio)
self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
self.resize(697, 763)
url = "http://www.eltiempo.es/"
html = Browser().open(url).read()
webView = Plasma.WebView(self.applet)
webView.setHtml(html)
self.layout.addItem(webView)
self.setLayout(self.layout)
Please, I appreciate some type of help. The especial characters ('ñ' 'º' 'á' 'é' ª ...) don't show correctly when I use the setHml function. However if I write the setUrl function the webpage shows correctly. I have tried to save the html content in a file.html and I can visualize well with a browser (firefox, chrome...). Furthermore, I tried the setUrl function with a file///directory/code.html argument and it works too.
I need the setHtml code because I have to modify the code before showing it.
I read about "Adding an explicit style to the string being passed in solved the problem" but I dont understand what I have to do (english isn't my first language).
Thank You for reading and please, heeeeelp!!




Reply With Quote

Bookmarks