我正在使用PyQt4创建一个应用程序,以便能够在不从系统加载本地HTML文件的情况下查看内联文本HTML标记 . 但是,我对HTML的字符串格式有一些问题 . 这段代码只显示了Window而不是HTML文本 . 请帮忙 .
# imported all the modules
class HtmlView(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
.................
# i've skipped the layout definition here
................
# an inline text with html mark-up
text = "
This is a paragraph
self.html = QtWebKit.QWebView()
# setting layout
self.gridLayout.addWidget(self.html)
self.mainLayout.addWidget(self.frame)
self.setCentralWidget(self.centralwidget)
self.web_page = text
url = self.web_page
self.html.load(QtCore.QUrl(url))
self.html.show()
# executing using if __name__ == "main": skipped this part
请告诉我如何在QWebView()中更改元素
和