[PyKDE] Re: Kcontrol modules.

David Boddie david at boddie.org.uk
Thu Jul 10 00:22:00 BST 2003


Following up to this again as things change...

On Tue, 8 Jul 2003 20:21:21, Simon Edwards <simon at simonzone.com> wrote:

> I had a look at the IOSlave code and saw that it works quite differently
> than kcms. Kcms are basically shared libraries that have a factory method
> that returns a instances of a subclass of KCModule.

Well, I've managed to get kicker to load a shared library and call the C++
"init" factory function as normal. This starts a Python interpreter, looks
for the relevant Python module, imports it then calls the "init" function in
the module. The "init" function creates an instance of the KPanelApplet
subclass and returns this to the C++ function.

-> C++ "init"
   ...
           -> Python "init"
              ...
                      -> AppletClass.__init__
                         ...
              applet  <-
              ...
   pInstance <-

The instance is then converted to a pointer using

    panel_applet = (KPanelApplet*)sipMapSelfToThis(pInstance);

which is returned to the caller. Kicker (or its applet loading proxy) then
crashes, rather unhelpfully failing to provide a traceback.

Any ideas on what I'm doing wrong would be good at this point.

David




More information about the PyQt mailing list