直接贴码:
#coding=utf-8 import sys from PyQt4.QtCore import Qt from PyQt4.QtGui import QApplication, QCompleter, QLineEdit, QStringListModel def get_data(model): model.setStringList(["completion", "data", "goes", "here", "cu1609", "cu1610", "cu1611"]) if __name__ == "__main__": app = QApplication(sys.argv) edit = QLineEdit() completer = QCompleter() edit.setCompleter(completer) model = QStringListModel() completer.setModel(model) get_data(model) edit.show() sys.exit(app.exec_())
效果图如下:
文章的脚注信息由WordPress的wp-posturl插件自动生成