[Qt-interest] Qt 4.8 bug?

Joshua Grauman jnfo-c at grauman.com
Wed May 25 01:19:13 CEST 2011


Hello all,

I'm trying out the new technology preview of Qt 4.8, and my app won't 
compile (it compiled fine under Qt 4.7). The error is in a generated moc 
file. I have a derived class KLineEdit which derives from QLineEdit. Here 
is the error:


moc_ktextedit.cpp: In static member function 'static void 
KLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, 
void**)':

moc_ktextedit.cpp:187: error: cannot convert from base 'QObject' to 
derived type 'KLineEdit' via virtual base 'QLineEdit'
make: *** [moc_ktextedit.o] Error 1


And here is the moc file that caused the error. Anyone know what's going 
on here? Is this a bug? Thanks!

void KLineEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
     if (_c == QMetaObject::InvokeMetaMethod) {
         Q_ASSERT(staticMetaObject.cast(_o));
         KLineEdit *_t = static_cast<KLineEdit *>(_o);  ///****This is the line
         switch (_id) {
         case 0: _t->setText((*reinterpret_cast< const QString(*)>(_a[1]))); break;
         default: ;
         }
     }
}

Josh



More information about the Qt-interest-old mailing list