Pydev 1.5.0 code anlaysis breaks code pyqt4 code completion
Brought to you by:
fabioz
I have pyqt 4.5.4 installed. Initially I had pydev 1.4.8 the open source version installed and code completion worked fine. After updating to pydev 1.5.0, pyqt code completion stopped functioning. After disabling the Pydev code analysis in "eclipse preferences -> pydev -> editor -> code analysis -> do code analysis?" code completion began working again for PyQt classes etc.
Do you have some error in your error log when the code analysis/code completion fails?
Ok, I've been able to reproduce it. it's actually a PyQt4 bug at version 4.5.4 (not sure about other versions).
[D:\bin\4nt-7.01.360]d:\bin\Python261\python.exe
Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtCore import *
>>> QSignalMapper
<class 'PyQt4.QtCore.QSignalMapper'>
>>> import inspect
>>> inspect.ismodule(QSignalMapper) <-- this will make the interpreter crash!
A workaround until PyQt4 fixes that is editing eclipse/plugins/org.python.pydev/PySrc/importsTipper.py at line 154, changing:
"for d in dirComps:"
to:
for d in dirComps:
....if d == 'QSignalMapper':
........continue
The workaround does work for me. Thank you.
Marking as wont fix because it's a pyqt bug.