def __init__(self, parent=None): QTextBrowser.__init__(self, parent) self.setOpenLinks(False) self.item = None self.dirty = False self._clear() self._showPluginInfo() self.anchorClicked.connect(self._linkClicked)
def setHtml(self, html): # convert special tags :) html = unicode(html).replace( '<warning>', '<img src=":/db_manager/warning"> ') # add default style html = u""" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style type="text/css"> .section { margin-top: 25px; } table.header th { background-color: #dddddd; } table.header td { background-color: #f5f5f5; } table.header th, table.header td { padding: 0px 10px; } table td { padding-right: 20px; } .underline { text-decoration:underline; } </style> </head> <body> %s <br> </body> </html> """ % html # print ">>>>>\n", html, "\n<<<<<<" return QTextBrowser.setHtml(self, html)
def setHtml(self, html): # convert special tags :) html = unicode(html).replace('<warning>', '<img src=":/db_manager/warning"> ') # add default style html = u""" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style type="text/css"> .section { margin-top: 25px; } table.header th { background-color: #dddddd; } table.header td { background-color: #f5f5f5; } table.header th, table.header td { padding: 0px 10px; } table td { padding-right: 20px; } .underline { text-decoration:underline; } </style> </head> <body> %s <br> </body> </html> """ % html # print ">>>>>\n", html, "\n<<<<<<" return QTextBrowser.setHtml(self, html)