本文整理汇总了Python中aqt.webview.AnkiWebView.stdHtml方法的典型用法代码示例。如果您正苦于以下问题:Python AnkiWebView.stdHtml方法的具体用法?Python AnkiWebView.stdHtml怎么用?Python AnkiWebView.stdHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aqt.webview.AnkiWebView
的用法示例。
在下文中一共展示了AnkiWebView.stdHtml方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onhanziStats
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def onhanziStats():
mw.progress.start(immediate=True)
rep = genhanziStats()
d = QDialog(mw)
l = QVBoxLayout()
w = AnkiWebView()
l.addWidget(w)
css = "font{word-wrap:break-word;} div{display:none;}"
w.stdHtml(rep, css)
d.setLayout(l)
d.resize(500, 400)
restoreGeom(d, "hanzistats")
mw.progress.finish()
d.exec_()
saveGeom(d, "hanzistats")
示例2: onRevlog
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def onRevlog(self):
data = self._revlogData()
d = QDialog(self)
l = QVBoxLayout()
l.setMargin(0)
w = AnkiWebView()
l.addWidget(w)
w.stdHtml(data)
bb = QDialogButtonBox(QDialogButtonBox.Close)
l.addWidget(bb)
bb.connect(bb, SIGNAL("rejected()"), d, SLOT("reject()"))
d.setLayout(l)
d.setWindowModality(Qt.WindowModal)
d.resize(500, 400)
restoreGeom(d, "revlog")
d.exec_()
saveGeom(d, "revlog")
示例3: onKanjiStats
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def onKanjiStats():
mw.progress.start(immediate=True)
rep = genKanjiStats()
d = QDialog(mw)
l = QVBoxLayout()
l.setMargin(0)
w = AnkiWebView()
l.addWidget(w)
w.stdHtml(rep)
bb = QDialogButtonBox(QDialogButtonBox.Close)
l.addWidget(bb)
bb.connect(bb, SIGNAL("rejected()"), d, SLOT("reject()"))
d.setLayout(l)
d.resize(500, 400)
restoreGeom(d, "kanjistats")
mw.progress.finish()
d.exec_()
saveGeom(d, "kanjistats")
示例4: onhanziStats
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def onhanziStats():
mw.progress.start(immediate=True)
rep = genhanziStats()
d = QDialog(mw)
l = QVBoxLayout()
l.setMargin(0)
w = AnkiWebView()
l.addWidget(w)
css = "font{word-wrap:break-word;} div{display:none;}"
w.stdHtml(rep, css)
bb = QDialogButtonBox(QDialogButtonBox.Close)
l.addWidget(bb)
bb.connect(bb, SIGNAL("rejected()"), d, SLOT("reject()"))
d.setLayout(l)
d.resize(500, 400)
restoreGeom(d, "hanzistats")
mw.progress.finish()
d.exec_()
saveGeom(d, "hanzistats")
示例5: __init__
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def __init__(self, reviewer, card, parent=None):
QDialog.__init__(self, parent=None)
self.card = card
self.reviewer = reviewer
self.mw = reviewer.mw
self.col = self.mw.col
info, cs = self._cardInfoData()
reps = self._revlogData(cs)
l = QVBoxLayout()
l.setMargin(0)
w = AnkiWebView()
l.addWidget(w)
w.stdHtml(info + "<p>" + reps)
bb = QDialogButtonBox(QDialogButtonBox.Close)
l.addWidget(bb)
bb.connect(bb, SIGNAL("rejected()"), self, SLOT("reject()"))
self.setLayout(l)
self.setWindowModality(Qt.WindowModal)
self.resize(500, 400)
restoreGeom(self, "CardStatShowDialog")
示例6: showCardInfo
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def showCardInfo(self):
if not self.card:
return
info, cs = self._cardInfoData()
reps = self._revlogData(cs)
d = QDialog(self)
l = QVBoxLayout()
l.setMargin(0)
w = AnkiWebView()
l.addWidget(w)
w.stdHtml(info + "<p>" + reps)
bb = QDialogButtonBox(QDialogButtonBox.Close)
l.addWidget(bb)
bb.connect(bb, SIGNAL("rejected()"), d, SLOT("reject()"))
d.setLayout(l)
d.setWindowModality(Qt.WindowModal)
d.resize(500, 400)
restoreGeom(d, "revlog")
d.exec_()
saveGeom(d, "revlog")
示例7: showHTML
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def showHTML(html, modality=Qt.WindowModal):
m = QMainWindow(mw.app.activeWindow())
d = QDialog(m)
l = QVBoxLayout()
l.setMargin(0)
w = AnkiWebView()
l.addWidget(w)
bb = QDialogButtonBox(QDialogButtonBox.Close)
l.addWidget(bb)
bb.connect(bb, SIGNAL("rejected()"), d, SLOT("reject()"))
d.setLayout(l)
d.setWindowModality(modality)
d.resize(500, 400)
restoreGeom(d, "htmlview")
w.stdHtml(html)
if modality == Qt.WindowModal :
d.exec_()
else :
d.show()
saveGeom(d, "htmlview")
示例8: updateWindow
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import stdHtml [as 别名]
def updateWindow(self, html):
if html is None:
return False
# build view
webview = AnkiWebView()
webview.stdHtml(html, mw.sharedCSS)
webview.setLinkHandler(self.links)
# Clear old layout
if self.__layout:
QObjectCleanupHandler().add(self.__layout)
# build layout
self.__layout = QVBoxLayout()
self.__layout.setMargin(0)
self.__layout.addWidget(webview)
# Update window
self.setLayout(self.__layout)
self.update()