本文整理汇总了Python中PyQt5.QtWidgets.QCompleter.maxVisibleItems方法的典型用法代码示例。如果您正苦于以下问题:Python QCompleter.maxVisibleItems方法的具体用法?Python QCompleter.maxVisibleItems怎么用?Python QCompleter.maxVisibleItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QCompleter
的用法示例。
在下文中一共展示了QCompleter.maxVisibleItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QCompleter [as 别名]
# 或者: from PyQt5.QtWidgets.QCompleter import maxVisibleItems [as 别名]
def __init__(self,expdat):
super(DBAnnotateSave, self).__init__()
print("DBAnnotateSave")
uic.loadUi(os.path.join(hs.heatsequerdir,'ui/manualdata.py'), self)
self.bplus.clicked.connect(self.plus)
self.bminus.clicked.connect(self.minus)
self.bontoinput.returnPressed.connect(self.plus)
self.bstudyinfo.clicked.connect(self.studyinfo)
self.bisa.toggled.connect(self.radiotoggle)
self.bdiffpres.toggled.connect(self.radiotoggle)
self.bisatype.currentIndexChanged.connect(self.isatypechanged)
self.bhistory.clicked.connect(self.history)
self.cexp=expdat
self.lnumbact.setText(str(len(expdat.selectedseqs)))
completer = QCompleter()
self.bontoinput.setCompleter(completer)
scdb=hs.scdb
self.scdb=scdb
self.dataid=hs.supercooldb.finddataid(scdb,datamd5=self.cexp.datamd5,mapmd5=self.cexp.mapmd5)
model = QStringListModel()
completer.setModel(model)
# completer.setCompletionMode(QCompleter.InlineCompletion)
completer.maxVisibleItems=10
completer.setCaseSensitivity(Qt.CaseInsensitive)
# make the completer selection also erase the text edit
completer.activated.connect(self.cleartext,type=Qt.QueuedConnection)
# in qt5 should work with middle complete as well...
# completer.setFilterMode(Qt.MatchContains)
if not hs.scdb.ontologyfromid:
hs.scdb=hs.supercooldb.loaddbonto(hs.scdb)
self.ontology=hs.scdb.ontology
self.ontologyfromid=hs.scdb.ontologyfromid
nlist=list(self.ontology.keys())
# nlist=sorted(nlist)
nlist=sorted(nlist, key=lambda s: s.lower())
print("sorted ontology")
model.setStringList(nlist)
self.setWindowTitle(self.cexp.studyname)
try:
tt=hs.lastdatamd5
except:
hs.lastdatamd5=''
if self.cexp.datamd5==hs.lastdatamd5:
self.fillfromcuration(hs.lastcurations[-1],onlyall=True)
self.prefillinfo()
self.bontoinput.setFocus()