[Kde-bindings] Re: AW: AW: [Kde-perl] PerlQt port for Qtopia / Zaurus?

Ashley Winters jahqueel at yahoo.com
Sun Jan 26 01:40:39 UTC 2003


--- Germain Garand <germain at ebooksfrance.com> wrote:
> Le Mercredi 22 Janvier 2003 00:04, Richard Dale a écrit :
> > I have done a prototype of proxy based slots/signals that worked
> with smoke
> > (I favour this way, and Ashley doesn't..). It would be interesting
> to
> > compare a proxy based solution with Ashley's 'hack the metadata and
> > reimplement moc generated code' type solution.
> 
> Looking back at your prototype, I think it would be very interesting
> but IIUC, 
> it would mean having a hundred or so proxy classes, to cover the
> whole 
> spectrum of possible combination of Sig/Slot basic types (to what
> depth ? 6 
> or 8 arguments ? )...
> That sounds hudge and a bit limiting... or am I missing something ?

Only something small. :)

In actuality, you only need one class (ProxySlot, for instance) which
would proxy all the signal/slot prototypes in Qt. In reality, there are
only about 70-100 (?) variations of signal/slot arguments in Qt and
KDE, which is all you'd "need" for a language binding. That's how PyQt
and Qt/Java work.

However, in never-never land, you'll notice something Bad can happen.
Consider this thought experiment!

class QFoo {
public:
    void insertThing(const QString &name, QThing *object, const char
*);

    // Note: the 'receiver' isn't a QObject! Read on for implications
    // It's a subclass of QObject, and that's 100% legal.

    // Secondly: the 'member' argument is unmarked. You'd have to code
    // in by hand that the second object needs a slot proxy and
    // the third argument is a signal/slot member
};

# From PerlQt:
$foo->insertThing('&Foo', $object, SLOT 'whatever()');

In order for insertThing() to connect to the proper slot, PerlQt would
have to (transparently, AND specified by hand) pass $object's ProxySlot
object to insertThing(). However, it's perfectly legal for
insertThing() -- written in C++ -- to call
object->thingSpecificFunction(), which would die on a proxy slot
inherited from QObject. Creating 100 little subclasses of all the
QObject child classes for signal/slot information is impractical, even
if that could fix it (which it wouldn't).

This all stems from the fact that connect() isn't virtual, and the
meta-object interface has no friendly introspective wrapper class we
can all use like happy lemmings. Here's waiting for Qt-4.x...

Okay, I'm not actually ticked about it, since PerlQt-3's ugly,
disgusting hack doesn't suffer from those problems. :)

Ashley Winters

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Kde-bindings mailing list