当前位置: 首页>>代码示例>>Python>>正文


Python AnkiWebView.stdHtml方法代码示例

本文整理汇总了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")
开发者ID:trevorld,项目名称:Hanzi_Stats,代码行数:17,代码来源:__init__.py

示例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")
开发者ID:lahorichargha,项目名称:ankiqt,代码行数:19,代码来源:browser.py

示例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")
开发者ID:igorfarias,项目名称:ankiplugins,代码行数:20,代码来源:stats.py

示例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")
开发者ID:trevorld,项目名称:Hanzi_Stats,代码行数:21,代码来源:Hanzi_Stats.py

示例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")
开发者ID:steveaw,项目名称:anki_addons,代码行数:22,代码来源:reviewer_show_cardinfo.py

示例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")
开发者ID:lahorichargha,项目名称:ankiqt,代码行数:22,代码来源:browser.py

示例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")
开发者ID:albertly,项目名称:TTS,代码行数:22,代码来源:Colorful+toolbar.py

示例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()
开发者ID:from3004,项目名称:AnkiEmperor,代码行数:24,代码来源:AnkiEmperor.py


注:本文中的aqt.webview.AnkiWebView.stdHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。