[PyKDE] SIP Changes to Support ActiveX

Phil Thompson phil at riverbankcomputing.co.uk
Sat Oct 2 17:54:35 BST 2004


The current SIP v4 snapshot has a new implementation of connections between Qt 
signals and Python slots/callables. This is needed to support "external" 
signals from ActiveX controls on Windows. It may also be needed for DBUS 
support in Qt v4.

Signal arguments that have an unsupported type are replaced with the 
NotImplemented object. At the moment enums and mapped types are unsupported, 
but this will be fixed in later snapshots. The same mechanism will also be 
used to fix the PyKDE problem when typedefs have been used in signal 
arguments.

The way this has been implemented only works with Qt v3. Consequently, if you 
are (still) using Qt v1 or v2 you must use SIP v3.

You will need to re-build PyQt. First you will need to hack PyQt's 
configure.py so that the qtaxcontainer module gets built. Find the test for 
SIP v4.2 and remove it...

 if sys.platform == "win32" and sipcfg.sip_version >= 0x040200:

...becomes...

 if sys.platform == "win32":

The current PyQt snapshot includes a port to Python of the Qt webbrowser 
example which embeds Internet Explorer in a Qt widget.

The qtaxcontainer module implements the QAxObject and QAxWidget classes - look 
at the qaxobject.sip and qaxwidget.sip files to see exactly what has been 
implemented. I would like feedback on this - is what has been implemented 
useful? Does more need to be implemented for real-world applications?

Phil




More information about the PyQt mailing list