How to get code completion for PyQt using Pydev
This is my OLD blog. I've copied this post over to my NEW blog at:
http://www.saltycrane.com/blog/2007/06/how-to-get-code-completion-for-pyqt/
You should be redirected in 2 seconds.
Because PyQt doesn't come with the .py source files which Pydev needs for code completion, you need to add the PyQt modules as a "forced builtin lib". See the following FAQs at the pydev website: http://pydev.sourceforge.net/faq.html#ref_22 and http://pydev.sourceforge.net/faq.html#ref_15
Here are the steps:
- Go to "Window" -> "Preferences..." -> "Pydev" -> "Interpreter - Python"
- In the "Forced builtin libs" section, click "New..."
- Type in "PyQt4" and click "OK".
- Click "OK" to close the Preferences window.
Note: If you installed PyQt after installing Pydev, you will probably have to update the PYTHONPATH with the path to the PyQt libraries. You can do this easily by "Remove"ing the python interpreter and then re-adding it in again. (For reference, I am using Eclipse 3.2.2, Pydev 1.3.4, Python 2.5.1, and PyQt 4.2.3)
1 comment:
Code completion now works fine for me, except for some classes. For example:
if I write: from PyQt4 import
it only shows me two class available: QtCore and QtGui, for example I cannot see QtNetwork, but if I write it by hand, my code execute it without problems.
Any suggestion about this problem?
Post a Comment