[PyQt] [PyKDE] KTextEditor interface classes
jbublitz at nwinternet.com
Sat Aug 30 03:26:45 BST 2008
On Friday 29 August 2008 18:09, Paul Giannaros wrote:
> No, they're not. All of the Interface classes are simple QObject-inheriting
> classes. When a project wants to implement the KTextEditor interface
> they'll do something like:
> class MyInternalView : public KTextEditor::View, public Interface1,
> public Interface2, public Interface3 ....
OK - the multiple inheritance may be a problem that'll require handwritten
code,especially if the base object is QObject, since that already should have
CTSCC code for each class (depending on how the project file is written).
> A pointer to a MyInternalView object would be passed around to plugins and
> anything else using the KTE API cast as a View.
> I hope that makes sense.
> > If that's not what you want, then it seems you'll have to write C++ code
> > and add it to the bindings, which is not that hard to do.
> If I'm not mistaken then that's what I'll need to. I'll get into
> contact with Simon
> Edwards -- I'm not sure what his auto-generation process is like and
> therefore how he wants patches.
It's designed to handle stuff like that once you add it to the sip file. It'll
carry forward to each new version (but needs to changed manually if there are
changes between versions). For most stuff, you only need to write it once.
It would be fairly easy to add the method you described earlier, for example -
sip is as useful for extending a library for Python as for binding it.
More information about the PyQt