[Kde-bindings] Confusing results from kalyptus

Richard Dale rdale at foton.es
Tue Aug 18 10:56:15 UTC 2009


On Friday 14 August 2009 09:21:02 pm Chris Burel wrote:
> I'm confused by what I'm seeing in the generated smokedata.cpp file for
> SmokeQt, specifically the xcall() index for some entries in the qt_methods
> array.  This seems to affect a number of methods, but for example:
>    {385, 10016, 63, 3, Smoke::mf_const, 1991, 552},    //14932
> QStyle::pixelMetric(QStyle::PixelMetric, const QStyleOption*, const
> QWidget*) const [pure virtual]
>    {385, 10016, 60, 2, Smoke::mf_const, 1991, -1},    //14933
> QStyle::pixelMetric(QStyle::PixelMetric, const QStyleOption*) const [pure
> virtual]
>    {385, 10016, 58, 1, Smoke::mf_const, 1991, -1},    //14934
> QStyle::pixelMetric(QStyle::PixelMetric) const [pure virtual]
>
> Why is the xcall index for the 2 argument and 1 argument form of the same
> method -1, while the 3 argument form has a valid xcall index?  Doesn't that
> mean that calling the 1 and 2 argument forms won't actually do anything?
What happened was that it wasn't originally possible to call pure virtual 
methods in the smoke library. Then we realised we needed to be able you use 
things like abstract models that were allocated on the C++ side with internal 
implementations - you need to be able to call pure virtual methods on those. 
So we did the minimum to get it working which was to allow pure virtual 
methods to be with the maximum number of arguments to be called if args had 
default values. 

It is a bug/usabiltiy problem, but I looked at the code generated by Arno's 
new smokegenerator and it does generate all three of the QStyle::pixelMetric() 
methods in the example above. So it will be fixed when we switch to using that 
instead of kalyptus in a week or two.

-- Richard



More information about the Kde-bindings mailing list