[PyKDE] Metaobjects ?

Bradley Schatz bradley.schatz at netali.com
Fri Dec 10 16:31:44 GMT 1999


Hi Phil,

Thanks for replying..

> QMetaObject could be implemented, but...
>
> - it isn't documented (it's really for Qt's internal use)
>

I believe that for any component API there needs to exist some kind of Class
metadata source: wether it be a repository, type library (the MS approach), or
a class with Metainformation (eg Java BeanInfo class). This kind of thing has
long been optional or missing from standard C++, and I am grateful that Troll
have added these features to QT.

>
> - if you wanted ViPyl to handle Python widgets derived from Qt widgets,
> how would you capture their meta information (ie. the extra methods,
> signals and slots implemented in Python)?
>

Perhaps the bindings could add python declared slots to the __methods__
property of the Python proxy object.

>
> > I see that static member functions are now supposed to be woorking, how
> > hard would it be to have this work?
>
> What's this got to do with it?

My mistake - nothing. (i have been coding too much java lately :-)


>
> > Any suggestions on how I could get the signature of a method as well? ie
> > the types it returns, and the parameters it expects?
>
> No - all of that is buried in the generated C++ code.  The only thing
> that springs to mind is for SIP to generate this extra information so it
> could be picked up by ViPyl and similar tools.  It could be done as a
> file which ViPyl parses (not too bad if a standard can be agreed), or
> included as data structures in the bindings (I don't like).
>

Since we dont have any relfection mechanisms in C++ I think that a file based
approach would work fine.The signal and slot signatures could be generated
into a XML format similar to that used in your sip files for documentation for
reading by ViPyl. Is this difficult?

cheers

Bradley









More information about the PyQt mailing list