[PyQt] PyQt 4.4.3 and Stackless Python 2.6 compilation

Carlos Eduardo carlosedp at gmail.com
Wed Oct 29 18:26:27 GMT 2008


Hi Phil,

Some time ago, I had some problems compiling SIP with Stackless Python. 
That had been fixed manually by me until you patched siplib.c using a pair of
ifdefs.

Now, I'm recompiling my toolchain using the latest versions and found an
incompatibility between PyQt and Stackless.

The problem lies on sip/QtCore/qobject.sip. It defines a heap structure that
tries to find a reference in Python's PyHeapTypeObject but stackless does not
define this structure, it just aliases from the PyTypeObject that does not have
that slot. This breaks PyQt compilation.

I have created a patch that addresses this issue. The test had been made on
Windows XP, using Stackless Python 2.6 and QT 4.4.3 and had been applied and
compiled/worked successfully on PyQt-win-gpl-4.4.3 and
PyQt-win-gpl-4.4.4-snapshot-20081022.

Here is the patch:

--- qobject.sip.orig    2008-10-28 15:18:50.511598400 -0200
+++ qobject.sip 2008-10-28 15:19:56.500249100 -0200
@@ -1308,12 +1308,16 @@

         case class_sat:
             {
+#if defined(STACKLESS)
+                int type = QMetaType::type(as->type.u.wt->super.tp_name);
+#else
 #if PY_VERSION_HEX >= 0x02050000
                 int type = QMetaType::type(as->type.u.wt->super.ht_type.tp_name);
 #else
                 int type = QMetaType::type(as->type.u.wt->super.type.tp_name);
 #endif

+#endif
                 // The type must be supported by the meta-object system.
                 if (type)
                 {


I hope this could be applied to PyQt so users of Stackless does not need to
patch and compile PyQt manually.

Regards,

Carlos



More information about the PyQt mailing list