本文整理汇总了Python中aqt.webview.AnkiWebView.setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:Python AnkiWebView.setFixedHeight方法的具体用法?Python AnkiWebView.setFixedHeight怎么用?Python AnkiWebView.setFixedHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aqt.webview.AnkiWebView
的用法示例。
在下文中一共展示了AnkiWebView.setFixedHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Browser
# 需要导入模块: from aqt.webview import AnkiWebView [as 别名]
# 或者: from aqt.webview.AnkiWebView import setFixedHeight [as 别名]
class Browser(QMainWindow):
def __init__(self, mw):
QMainWindow.__init__(self, mw)
applyStyles(self)
self.mw = mw
self.col = self.mw.col
self.currentRow = None
self.lastFilter = ""
self.form = aqt.forms.browser.Ui_Dialog()
self.form.setupUi(self)
restoreGeom(self, "editor", 0)
restoreState(self, "editor")
restoreSplitter(self.form.splitter_2, "editor2")
restoreSplitter(self.form.splitter, "editor3")
self.form.splitter_2.setChildrenCollapsible(False)
self.form.splitter.setChildrenCollapsible(False)
self.card = None
self.setupToolbar()
self.setupColumns()
self.setupTable()
self.setupMenus()
self.setupSearch()
self.setupTree()
self.setupHeaders()
self.setupHooks()
self.setupEditor()
self.updateFont()
self.onUndoState(self.mw.form.actionUndo.isEnabled())
self.form.searchEdit.setFocus()
self.show()
self.form.searchEdit.setText("deck:current is:recent")
self.form.searchEdit.selectAll()
self.onSearch()
def setupToolbar(self):
self.toolbarWeb = AnkiWebView()
self.toolbarWeb.setFixedHeight(32)
self.toolbar = BrowserToolbar(self.mw, self.toolbarWeb, self)
self.form.verticalLayout_3.insertWidget(0, self.toolbarWeb)
self.toolbar.draw()
def setupMenus(self):
# actions
c = self.connect; f = self.form; s = SIGNAL("triggered()")
c(f.actionReposition, s, self.reposition)
c(f.actionReschedule, s, self.reschedule)
c(f.actionCram, s, self.cram)
c(f.actionChangeModel, s, self.onChangeModel)
# edit
c(f.actionOptions, s, self.onOptions)
c(f.actionUndo, s, self.mw.onUndo)
c(f.actionInvertSelection, s, self.invertSelection)
c(f.actionSelectNotes, s, self.selectNotes)
c(f.actionFindReplace, s, self.onFindReplace)
c(f.actionFindDuplicates, s, self.onFindDupes)
# jumps
c(f.actionPreviousCard, s, self.onPreviousCard)
c(f.actionNextCard, s, self.onNextCard)
c(f.actionFind, s, self.onFind)
c(f.actionNote, s, self.onNote)
c(f.actionTags, s, self.onTags)
c(f.actionCardList, s, self.onCardList)
# help
c(f.actionGuide, s, self.onHelp)
runHook('browser.setupMenus', self)
def updateFont(self):
self.form.tableView.setFont(QFont(
self.mw.pm.profile['editFontFamily'],
self.mw.pm.profile['editFontSize']))
self.form.tableView.verticalHeader().setDefaultSectionSize(
self.mw.pm.profile['editLineSize'])
def closeEvent(self, evt):
saveSplitter(self.form.splitter_2, "editor2")
saveSplitter(self.form.splitter, "editor3")
self.editor.saveNow()
self.editor.setNote(None)
saveGeom(self, "editor")
saveState(self, "editor")
saveHeader(self.form.tableView.horizontalHeader(), "editor")
self.col.conf['activeCols'] = self.model.activeCols
self.hide()
aqt.dialogs.close("Browser")
self.teardownHooks()
self.mw.maybeReset()
evt.accept()
def keyPressEvent(self, evt):
"Show answer on RET or register answer."
if evt.key() == Qt.Key_Escape:
self.close()
elif self.mw.app.focusWidget() == self.form.tree:
if evt.key() in (Qt.Key_Return, Qt.Key_Enter):
item = self.form.tree.currentItem()
self.onTreeClick(item, 0)
def setupColumns(self):
self.columns = [
#.........这里部分代码省略.........