From: Konrad Rosenbaum Date: Tue, 13 Mar 2012 12:30:30 +0000 (+0100) Subject: make lambda compatible with qt 4.7 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=f6230fd356e2969f897a91627dc5f96e0ce02d7a;p=web%2Fkonrad%2Fsmoke.git make lambda compatible with qt 4.7 --- diff --git a/src/misc/vlambda.cpp b/src/misc/vlambda.cpp index bbaead2..6a7cab3 100644 --- a/src/misc/vlambda.cpp +++ b/src/misc/vlambda.cpp @@ -16,6 +16,9 @@ using namespace std; using namespace MVLambdaNS; + +//the static metacall was introduced in Qt 4.8 +#if QT_VERSION >= 0x040800 //static void MVLambdaBase::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { @@ -26,17 +29,21 @@ void MVLambdaBase::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id } } - //static const QMetaObjectExtraData MVLambdaBase::staticMetaObjectExtraData = { 0, MVLambdaBase::qt_static_metacall }; +static const short qtmetaversion=6; +#else +const QMetaObjectExtraData MVLambdaBase::staticMetaObjectExtraData = {0,0}; +static const short qtmetaversion=6; +#endif MVLambdaBase::MVLambdaBase(int cnt,QByteArray rt, QByteArray cn, QObject* parent) :QObject(parent),m_count(cnt),m_callparm(cn),m_callret(rt), qt_meta_data({ // content: - 6, // revision + qtmetaversion, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods (14 is start of method info) @@ -64,8 +71,16 @@ qt_meta_data({ // content: // after this line string_metadata must not be changed // !!!!!!! //register meta object - meta_object=QMetaObject({{&QObject::staticMetaObject, string_metadata.data(), - qt_meta_data, &MVLambdaBase::staticMetaObjectExtraData}}); + meta_object=QMetaObject({{ + &QObject::staticMetaObject, + string_metadata.data(), + qt_meta_data, +#if QT_VERSION >= 0x040800 + &MVLambdaBase::staticMetaObjectExtraData +#else + 0 +#endif + }}); } void* MVLambdaNS::MVLambdaBase::qt_metacast(const char* _clname)