from PyQt4 import QtGui,QtCore str = QtCore.QStringList(['a','air','airbus'])#预先设置字典 lineEdit = QtGui.QLineEdit() lineEdit.setCompleter(QtGui.QCompleter(str)) #将字典添加到lineEdit中这样只需要在lineEdit中输入‘a’,就会有下拉提示框出现了
PyQt: LineEdit的智能输入提示,布布扣,bubuko.com
原文地址:http://blog.csdn.net/u010640235/article/details/37933601