0

我正在尝试为行编辑小部件制作一个完成者。

这是信号:

QtCore.QObject.connect(self.lineEdit, QtCore.SIGNAL(_fromUtf8("textEdited(QString)")),self.get_data)

这是功能:

def get_data (self):
    try:
        completer = QCompleter () 
        self.lineEdit.setCompleter(completer)
        model = QStringListModel()
        completer.setModel(model)
        model.setStringList(["completion", "data", "goes", "here"])
        self.my_list = []
        self.lineEdit.show()
    except Exception as e :
        print 'error in get_data :' + str(e)

当我键入时,程序会显示要完成的内容,然后,python 进程会冻结并崩溃。

我在 64 位的 Windows 7 上运行带有 pyqt4 的 Python 2.7.3,它在我的另一台具有 32 位操作系统的计算机上具有相同的设置,并且工作正常。

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: python.exe
  Application Version:  0.0.0.0
  Application Timestamp:    4f84a524
  Fault Module Name:    QtGui4.dll
  Fault Module Version: 4.8.6.0
  Fault Module Timestamp:   53ad3fb0
  Exception Code:   c0000005
  Exception Offset: 000000000005a061
  OS Version:   6.1.7601.2.1.0.256.4
  Locale ID:    1033
  Additional Information 1: 028b
  Additional Information 2: 028b61b507ae8e061ab97bbd1a6b3a12
  Additional Information 3: 4424
  Additional Information 4: 4424b602091e9660fb8ddacd034e43e9
4

0 回答 0