On Friday October 31 2003 13:49, Roland Schulz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hey,
>
> trying to change the sip layer makes great advancement.
> Overwriting the className function already makes the Preview
> working!! Overwriting metaObject also makes signals, slots and
> propterties (partly) working!! So I think this will work.
> What I did for className is that I added to sipqtQWidget.h:
> virtual const char *className() const {return "FileChooser";}

I may be wrong (it happened once before I think), but it seems to 
me all you've done is move the C++ proxy idea back into 
sipqtQWidget.cpp.

Notice that you've set sipqtQWidget::className() to always return 
"FileChooser" now - in the proxy attempt you had it always 
returning "QWidget". I haven't traced out QtDesigner much at 
all, but it does use a lot of "idFromClassName" type calls, so 
it seems reasonable to expect that changing the object's class 
name will affect its behavior in QtDesigner.

It seems to me if it works in sipqtQWidget.cpp, it should work 
without modifying the PyQt cpp or sip files also.

I think you're modifying the same object - just in a different 
place. The other difference would be that in the proxy attempt, 
you overloaded *all* of QWidget's methods, not just the 
*virtual* methods, whereas that doesn't happen when you modify 
sipqtQWidget.cpp.

> How should I do this in qwidget.sip? How can I get the
> classname (of course harding it is only for testing)? Calling
> className from Python space gives the correct result, so this
> should be doable. How can I access variables defined in the
> Python claass? Is there a way to tell sip to add this
> className method to all classes?
> Probably all these questions are pretty stupid, but I just
> don't get how sip works.

Jim

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to