[Kde-bindings] smoke and missing methods

Richard Dale rdale at foton.es
Sun Oct 11 13:43:51 UTC 2009


On Sunday 11 October 2009 12:03:20 pm Petr Vanek wrote:
> hi all,
> 
> it looks like there is a bug in smoke that's causing some of my
> example programs to crash.
> 
> moke is not generating the alternate mappings for calls to pure
> virtual methods when default argument values are being used.
> 
> For example, we have:
> 
>   virtual QVariant QAbstractItemModel::data(const QModelIndex &index,
> int role = Qt::DisplayRole) const = 0;
> 
> smoke is only generating the mapping for the full version, but the
> version with the default argument is not mapped - see the second line
> below:
> 
> smokedata.cpp:	{11, 7204, 2325, 2, Smoke::mf_const, 1435, 15},	//252
> QAbstractItemModel::data(const QModelIndex&, int) const [pure virtual]
> smokedata.cpp:	{11, 7204, 2295, 1, Smoke::mf_const, 1435, -1},	//253
> QAbstractItemModel::data(const QModelIndex&) const [pure virtual]
> 
> the last integer is the method offset = -1 meaning not mapped
> 
> so in the definition for x_QAbstractItemModel, we have:
> 
>     void x_15(Smoke::Stack x) const {
>         // data(const QModelIndex&, int)
>         QVariant xret = this->data(*(const QModelIndex *)x[1].s_class,
> (int)x[2].s_int);
>         x[0].s_class = (void*)new QVariant(xret);
>     }
> 
> but nothing for the other alternative.
> 
> So - is it a bug or just a wrong interpretation of soke principles?
The perl bindings generator only generated the method will all the arguments, 
but I think the new C++ generator has all the methods. Which one are you 
using?

-- Richard



More information about the Kde-bindings mailing list