[PyKDE] Re: newest Version

Roland Schulz mail at r2s2.de
Thu Oct 30 09:33:01 GMT 2003

Hash: SHA1


On Thursday 30 October 2003 02:46, you wrote:
> On Wednesday 29 October 2003 22:40, Jim Bublitz wrote:
> > What I don't know is:
> >
> > Suppose the base class is QLineEdit which is:
> >
> >     QObject
> >         QWidget
> >             QFrame
> >                 QLineEdit
> >                     PyWidget
> >
> > Does it make a difference which type the factory function
> > returns?  I'm not sure about the meta data - each class adds
> > more slots, signals and properties.
> If it is cast as QWidget, anything receiving the pointer can work out
> what it really is by using its inherits method.
> > If you get
> > QWidget::metaObject(), will you get the QFrame and QLineEdit
> > meta data too?
> I would have thought that the meta object will still contain all the
> information that was stored in it regardless of the class used to call
> metaObject.
Right. If you call o->metaObject() you get the MetaObject of Object o. Even if
your pointer has a super class as type.

> When creating a meta object, I don't know whether you'd need to look at all
> the ancestors of your class to determine what to fill in or whether you
> just need to add the information relevant to the new class. I'd suspect the
> latter, but I look forward to being enlightened on the subject.
No you don't have to provide all info from the super classes. You just have to
provide the additional info from the class, plus a pointer to the super class
(from where the additional info is graped).

> > Finding the "topmost" Q* class might be difficult
> > - if required, it might be necessary to either have the Python
> > programmer specify it or have an external piece of code (in
> > Python - better introspection) determine it and set it in the
> > C++ files that create the plugin.
> If you know the name of the new widget class then you can find out its
> bases. It's probably easier to do this in Python since you can just
> look at its __bases__ attribute but it probably isn't too bad in C++.
Like I wrote in the direct response to Jim's Mail, you should be able to just
call metaObject to the underlayer C++ object.

> > The other issue is whether each Python-created widget (or group
> > of widgets in a module) needs a unique .so lib for its plugin,
> > or it's possible to create a single "proxy" plugin that will
> > handle any Python-created widget.
> A single one would be ideal, given that the factory obtains all the
> information it needs to distinguish between the plugins it is asked
> for.
This is already working, isn't it?

Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)


More information about the PyQt mailing list