0

I am trying to make a completer for an line edit widget.

Here is the signal :

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

And here is the function :

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)

When I type, the program shows the content to complete and after that, the python process is freezing and crashing.

I'm running Python 2.7.3 with pyqt4 on Windows 7 with 64 bit, it has the same setup on my other computer with a 32 bit OS and there it's working fine.

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
  • Please expand on "python process freezes and crashes", at least provide a stack trace. Also, a question like this would really benefit from a [mcve](http://stackoverflow.com/help/mcve), especially as that is very easy to provide for a Python question like this. – hyde Dec 26 '14 at 12:05
  • This is all the Info I can get : http://pastebin.com/ENugfpu8 – user3532371 Dec 26 '14 at 12:24
  • You can edit the question to add it there, with proper formatting... – hyde Dec 26 '14 at 12:25
  • You say you have the same setup on 64 bit AND 32 bit. Did you use the same installer for both OS then? You need to use pyqt4 meant for window 64 bit for it to work fine. – kartikg3 Dec 26 '14 at 13:57
  • hey thanks all for the advises . my problem was that the completer initialization was declared each time the function was called . strangely this is what caused the problem . – user3532371 Dec 26 '14 at 14:18
  • Please add that as your own answer here. – kartikg3 Dec 26 '14 at 18:50
  • Are you meaning to run all of the code in `get_data` *every* time the text is changed? Seems like that's just the initialisation code, not the event code. – 101 Dec 27 '14 at 06:01

0 Answers0