From f6230fd356e2969f897a91627dc5f96e0ce02d7a Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Tue, 13 Mar 2012 13:30:30 +0100 Subject: [PATCH] make lambda compatible with qt 4.7 --- src/misc/vlambda.cpp | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) 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) -- 1.7.2.5