[Kde-bindings] Qyoto: contructing a QPalette from a QColor

Richard Dale rdale at foton.es
Mon Oct 16 09:26:37 UTC 2006


On Sunday 15 October 2006 16:38, Arno Rehn wrote:
> Am Samstag, 14. Oktober 2006 22:04 schrieb Arno Rehn:
> > Hi,
> >
> > I've just tried to port the Qt tutourial t11 to C# and came across the
> > following error when trying to construct a QPalette from a QColor:
> >
> > [error message]
> >
> > It confuses me, that the stacktrace goes up to libsmokeqt.so.
> > The example in qtruby is functional. Is there a need for special
> > marshalling code or so?
>
> I've just tried some more things and the same problem occurs when
> constructing a QRegion from a QRect. One thing they all have in common is
> that they can be part of a QVariant. I looked through the QtRuby code and
> didn't see any declaration of these types that cause problems (QRegion and
> QPalette, there are more if I'm right). They're only in "class Variant <
> Qt::Base". What does this mean?
The problem was that there was no code to resolve ambiguous methods that were 
overloaded, when there was more than one possible candidate in the Smoke lib. 
It should be fixed now - so I hope this QRegion constructor is part of the 
same problem. We need to add a cache of C# MethodInfo to Smoke lib method ids 
so that the lookup only needs to be done once, as it's probably a bit slow - 
ie a Hashtable with a key of the MethodInfo for the method with a value of 
the Smoke method id as an int.  That's what QtRuby and PerlQt do, and we 
should do the same for Qyoto..

    static private Hashtable methodCache = new Hashtable();
    ...
    methodCache[callMessage.MethodBase] = (object) methodId;


-- Richard



More information about the Kde-bindings mailing list