[PyKDE] PyQt on Mac OS X (10.3) and keyboard focus
Phil Thompson
phil at riverbankcomputing.co.uk
Mon May 10 20:55:00 BST 2004
On Monday 10 May 2004 7:20 pm, Nicholas Bailey wrote:
> 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
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
> site-packages/pyqtconfig.py says
>
> 'pyqt_qt_sip_flags': '-x Qt_STYLE_WINDOWSXP -x
> Qt_STYLE_INTERLACE -t
> 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 Qt_3_3_0 refers to the version of the Qt API - not the version of Qt. The
value shown is correct.
> 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.
Current SIP snapshots hide that output so as not to confuse people :)
> 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.
Make sure you are using pythonw rather than python.
Phil
More information about the PyQt
mailing list