[Kde-bindings] smoke and missing methods

Petr Vanek petr at scribus.info
Sun Oct 11 11:03:20 UTC 2009


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?

petr




More information about the Kde-bindings mailing list