示例#1
0
 def setIp(self,index):
     name = index.data(Qt.DisplayRole)
     ip = None
     for contact in Config.openContacts():
         if contact[1] == name:
             ip = contact[0]
     if ip is not None:
         self.ui.lineEdit.setText(ip)
     else:
         print('Couldn\'t get ip')
示例#2
0
 def initModel(self):
     words = []
     for contact in Config.openContacts():
         words.append(contact[1])
     self.model = QStringListModel(words)
示例#3
0
 def makeContacts(self):
     text = ''
     for pair in Config.openContacts():
         text = text+pair[0]+' - '+pair[1]+'\n'
     self.ui.plainTextEdit.setPlainText(text)