It takes a bit of effort.
a) Go to Tools, Options, IDE Options, Special packages and add PyQt4
to the list
b) Tools, Edit Startup Scripts. Add to the end of pyscripter_init.py
the following:
from PyQt4 import QtCore, QtGui
c) Save and restart PyScripter, go to a new editor and type
from PyQt4 import QtCore, QtGui
QtGui.
and voila. Code completion is available.
Explanation:
Special packages are imported to the namespace of the internal
interpreter to improve code completion in the editor.
The second step is required because QtCore etc are not part of the
namespace of PyQt4 after the initial import i.e. If you open a python
shell and you do
>>> import PyQt4
>>> dir(PyQt4)
you do not see the QtCore etc. So in step b we are pre-importing PyQt4
and QtGui, QtCore in the internal interpreter which is used for code
completion of special packages. You could have done this manually by
switching to the internal interpreter, importing the units, switch
back to the remote interpreter to carry on working. But you would
have to do this every time you start PyScripter.
Make sure you use the remote interpreter (Run, Python Engine, Remote)
for running PyQt4 scripts and reinitialize before each run. (this is
the default),