[Qt4-preview-feedback] Moc: Q_INVOKABLE on ctor in namespace

Peter Kuemmel syntheticpp at gmx.net
Wed Feb 25 10:59:20 CET 2009


Version:
The Qt Meta Object Compiler version 61 (Qt 4.5.0)

Moc doesn't produce correct code for classes of a namespace and constructors marked with Q_INVOKABLE:


#include <QObject>

#define USE_N
#ifdef USE_N
namespace N
{
#endif
	class A : public QObject
	{
		Q_OBJECT

	public:
		Q_INVOKABLE A(int);
	};
#ifdef USE_N
}
#endif



Moc generates code which misses 'N::A':

static int N__A_qt_static_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    if (_c == QMetaObject::CreateInstance) {
        switch (_id) {
        case 0: { A *_r = new A((*reinterpret_cast< int(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;
        }
        _id -= 1;
        return _id;
    }
    _id = A::staticMetaObject.superClass()->static_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    return _id;
}



Peter

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01



More information about the Qt4-feedback mailing list