[PyKDE] PyQt on Mac OS X (10.3) and keyboard focus

Nicholas Bailey n.j.bailey at elec.gla.ac.uk
Mon May 10 20:21:01 BST 2004

I've recently spent a bit of time porting a very simple  
psycopg/PyQt-based database front end to MacOS-X from Linux. I am using  
the Mac's supplied python interpreter (2.3) and gcc (3.3); sip 4.0rc3;  
PyQt-mac-gpl-3.11 and qt-mac-free-3.3.2. The Qt is installed under  
/Developer/qt -> qt-mac-free-3.3.2.

All of the above seem to build and install fine. There are only  
slightly strange things: the first is that   
site-packages/pyqtconfig.py says

'pyqt_qt_sip_flags':         '-x Qt_STYLE_WINDOWSXP -x  
  WS_MACX -t Qt_3_3_0'

in the _pgk_config dictionary, when it was built against 3.3.2  
(configure.py in the sip directory says "Qt v3.3.2 free edition is  
being used.") The second is that the PyQt configure.py -c script  
complains a little:

Checking to see if the QInterlaceStyle class is a plugin...
cfgtest.cpp: In function `int main(int, char**)':
cfgtest.cpp:5: error: parse error before `(' token

but code generation carries on after that.

The problem is that the python program runs but is always below the  
level of the terminal window whence it was invoked. It also won't take  
the focus and anything typed on the keyboard appears on the terminal  
window rather than in the target widget. I seem to recall that this  
behaviour happened in an earlier version when the full path name to the  
python script was not supplied, but I have made sure to call it by an  
absolute path.

Is it likely I need to make changes to the python script, or has this  
behaviour been observed before?

Apologies if this is a FAQ. I have had a little look around, but could  
find nothing.



More information about the PyQt mailing list