Simplify QMetaObject::newInstance
To create space on stack for a QObject pointer QVariant is not really essential. Change-Id: Iaf04a4f77005e33823f0e14bfdc6fe927cb59867 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
This commit is contained in:
parent
dfba10441e
commit
d295b9b9cf
@ -207,13 +207,13 @@ QObject *QMetaObject::newInstance(QGenericArgument val0,
|
|||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
QVariant ret(QMetaType::QObjectStar, (void*)0);
|
QObject *returnValue = 0;
|
||||||
void *param[] = {ret.data(), val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
|
void *param[] = {&returnValue, val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
|
||||||
val5.data(), val6.data(), val7.data(), val8.data(), val9.data()};
|
val5.data(), val6.data(), val7.data(), val8.data(), val9.data()};
|
||||||
|
|
||||||
if (static_metacall(CreateInstance, idx, param) >= 0)
|
if (static_metacall(CreateInstance, idx, param) >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
return *reinterpret_cast<QObject**>(param[0]);
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user