PYQT5(3-3) QCompleter 자동 Lenovo 구현

656 단어
    def init_lineedit(self,items_list):
        #       
        a=[]
        for i in items_list:
            print(i['code'])
            a.append(i['code'])
        self.completer = QCompleter(a)
        #            : Qt.MatchStartsWith     (  )  Qt.MatchContains       Qt.MatchEndsWith     
        self.completer.setFilterMode(Qt.MatchContains)
        #            : QCompleter.PopupCompletion(  )QCompleter.InlineCompletion   QCompleter.UnfilteredPopupCompletion
        self.completer.setCompletionMode(QCompleter.PopupCompletion)
        #  lineedit     
        self.pid_edit.setCompleter(self.completer)

좋은 웹페이지 즐겨찾기