[PyKDE] Issue With PyQt, Sharp Zaurus/Qtopia, and QMenuBar

Tom 'Korpios' Tobin korpios at korpios.com
Wed Apr 24 16:12:01 BST 2002


After installing the Python IPK files currently listed on the Riverbank Computing website - python_2.2-1.2_arm.ipk and pyqt_3.1-1.0_arm.ipk - on my Sharp Zaurus SL-5500, I have noticed a problem with the QMenuBar class.

The problem seems to be that anytime a QMenuBar is used, the application crashes, usually with a segmentation fault.  This crash typically occurs as soon as the cursor is brought into and out of a QMenuBar region; on the Zaurus, some such scripts simply return to the command line without giving any visible output (errors, application, or otherwise).  No other UI components have caused this problem thus far.  The problem seems to occur both when writing my own code and when attempting to use example code.  QMenuBar components used by C++ applications seem to work fine.  The crash still seems to occur whether using qt.Application or qtpe.QPEApplication as the base.

I have duplicated the problem several times both with my SL-5500 and with Sharp's Qtopia desktop development environment.  If I use the equivalent code outside of the Qtopia environment (i.e. in a normal desktop Python/PyQt setting), everything works normally.

I have been trying to cross-compile PyQt based on the latest snapshots to see if this resolves the problem; I haven't had any luck with the compile process so far, as it breaks both on a cross-compile and a standard compile early on with errors such as the following:

g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/python2.2 -I/opt/Python/sip-3.2rc2-i686/siplib -I/opt/Qtopia/include -DQWS -I/usr/X11R6/include -fno-exceptions -fno-rtti -O2 -c qtcmodule.cpp  -fPIC -DPIC -o qtcmodule.lo
qtcmodule.cpp: In function `struct PyObject * sipDo_qt_xrootwin(PyObject *, PyObject *)':
qtcmodule.cpp:5803: implicit declaration of function `int qt_xrootwin(...)'
qtcmodule.cpp: In function `struct PyObject * sipDo_qt_xscreen(PyObject *, PyObject *)':
qtcmodule.cpp:5827: implicit declaration of function `int qt_xscreen(...)'
qtcmodule.cpp: In function `struct PyObject * sipDo_qt_xdisplay(PyObject *, PyObject *)':
qtcmodule.cpp:5851: implicit declaration of function `int qt_xdisplay(...)'
qtcmodule.cpp:5851: assignment to `void *' from `int' lacks a cast
make[2]: *** [qtcmodule.lo] Error 1

(The odd sip directory is just where I've left the libraries for now.)

I am truly puzzled; I have tried searching for a solution for several days now with no luck.

If anyone can actually run a Python script under Qtopia (on the Zaurus or otherwise) and implement QMenuBar without the script crashing, could you pass along an example?

Thank you for your time,

Tom Tobin
korpios at korpios.com




More information about the PyQt mailing list