本文整理汇总了Python中aqt.tagedit.TagEdit类的典型用法代码示例。如果您正苦于以下问题:Python TagEdit类的具体用法?Python TagEdit怎么用?Python TagEdit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TagEdit类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getTag
def getTag(parent, deck, question, tags="user", **kwargs):
from aqt.tagedit import TagEdit
te = TagEdit(parent)
te.setCol(deck)
ret = getText(question, parent, edit=te, **kwargs)
te.hideCompleter()
return ret
示例2: myGetField
def myGetField(parent, question, last_val, **kwargs):
te = TagEdit(parent, type=1)
te.completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion)
te.strings = last_val
te.showCompleter = lambda te=te: showCompleter(te)
ret = getText(question, parent, edit=te, **kwargs)
te.hideCompleter()
return ret
示例3: onTargetDeck
def onTargetDeck(self):
from aqt.tagedit import TagEdit
t = self.card.template()
d = QDialog(self)
d.setWindowTitle("Anki")
d.setMinimumWidth(400)
l = QVBoxLayout()
lab = QLabel(
_(
"""\
Enter deck to place new %s cards in, or leave blank:"""
)
% self.card.template()["name"]
)
lab.setWordWrap(True)
l.addWidget(lab)
te = TagEdit(d, type=1)
te.setCol(self.col)
l.addWidget(te)
if t["did"]:
te.setText(self.col.decks.get(t["did"])["name"])
te.selectAll()
bb = QDialogButtonBox(QDialogButtonBox.Close)
self.connect(bb, SIGNAL("rejected()"), d, SLOT("close()"))
l.addWidget(bb)
d.setLayout(l)
d.exec_()
if not te.text().strip():
t["did"] = None
else:
t["did"] = self.col.decks.id(te.text())
示例4: setDeck
def setDeck(self, initial=False):
d = QDialog(self)
d.setWindowModality(Qt.WindowModal)
frm = aqt.forms.setgroup.Ui_Dialog()
frm.setupUi(d)
from aqt.tagedit import TagEdit
te = TagEdit(d, type=1)
frm.groupBox.layout().insertWidget(0, te)
te.setCol(self.col)
d.connect(d, SIGNAL("accepted()"), lambda: self._onSetDeck(frm, te))
self.setTabOrder(frm.setCur, te)
self.setTabOrder(te, frm.setInitial)
if initial:
frm.setInitial.setChecked(True)
d.show()
te.setFocus()
示例5: getTag
def getTag(parent, deck, question, tags="user", **kwargs):
from aqt.tagedit import TagEdit
te = TagEdit(parent)
te.setDeck(deck)
return getText(question, parent, edit=te, **kwargs)