使用的的类是QtGui.QCompleter
from PyQt4 import QtGui,QtCore
str = QtCore.QStringList(['a','air','airbus'])#预先设置字典
lineEdit = QtGui.QLineEdit()
lineEdit.setCompleter(QtGui.QCompleter(str)) #将字典加入到lineEdit中
这样仅仅须要在lineEdit中输入‘a’,就会有下拉提示框出现了

相关文章:

  • 2021-06-24
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-12-15
  • 2021-04-25
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2021-06-18
  • 2022-01-05
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
相关资源
相似解决方案