diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-05-18 11:02:16 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-21 09:46:31 +0200 |
commit | 21aa7ac4d14243996606a91a4ad462389aa5c7f1 (patch) | |
tree | 9529ce395ac6ad2ee0c68a04013a0d71d9518c5b /src | |
parent | 299a2f39a17c5fb66def1a863e4ef8f46e4d8b87 (diff) | |
download | qtactiveqt-21aa7ac4d14243996606a91a4ad462389aa5c7f1.tar.gz |
Fixes to metaobject handling
1) Due to changes to metaobjects, QAxBase::qt_static_metacall has
replaced a direct qt_metacall use in ActiveQt. The qt_static_metacall
function offsets the method id, which seems to be necessary when slots
are invoked via Qt, but breaks when invocation comes via COM interface.
Fixed by correcting the offset where necessary.
2) In MetaObjectGenerator::metaObject() function (qaxbase.cpp), the
assert Q_ASSERT(!typeName.isEmpty()) is wrong, as empty typename is a
valid result here. Removed the assert.
3) The type_map in qaxserver.cpp needs "void" -> "void" mapping, as
QMetaMethod::typeName() no longer returns empty string for void.
Task-number: QTBUG-25804
Change-Id: I53fcae5ac3134b7da85ff2ab2e93f01460da7583
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 15 | ||||
-rw-r--r-- | src/activeqt/control/qaxserver.cpp | 1 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index cfc4ed0..b8809cc 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -394,7 +394,8 @@ public: QString nameString = QLatin1String(signame); void *argv[] = {0, &nameString, &pDispParams->cArgs, &pDispParams->rgvarg}; - QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, index, argv); + QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, + index - meta->methodOffset(), argv); } HRESULT hres = S_OK; @@ -467,7 +468,7 @@ public: if (ok) { // emit the generated signal if everything went well - QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, index, argv); + QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, index - meta->methodOffset(), argv); // update the VARIANT for references and free memory for (p = 0; p < pcount; ++p) { bool out; @@ -516,7 +517,8 @@ public: if (index != -1) { QString propnameString = QString::fromLatin1(propname); void *argv[] = {0, &propnameString}; - QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, index, argv); + QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, + index - meta->methodOffset(), argv); } QByteArray signame = propsigs.value(dispID); @@ -542,7 +544,8 @@ public: argv[1] = &var; // emit the "changed" signal - QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, index, argv); + QAxBase::qt_static_metacall(combase, QMetaObject::InvokeMetaMethod, + index - meta->methodOffset(), argv); } return S_OK; } @@ -3123,7 +3126,6 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co // Parameter types for (int i = -1; i < argc; ++i) { QByteArray typeName = (i < 0) ? it.value().type : paramTypeNames.at(i); - Q_ASSERT(!typeName.isEmpty()); int_data[paramsOffset++] = nameToTypeInfo(typeName, strings); } // Parameter names @@ -3451,7 +3453,8 @@ static bool checkHRESULT(HRESULT hres, EXCEPINFO *exc, QAxBase *that, const QStr if (QAxEventSink::signalHasReceivers(that->qObject(), "exception(int,QString,QString,QString)")) { void *argv[] = {0, &code, &source, &desc, &help}; - QAxBase::qt_static_metacall(that, QMetaObject::InvokeMetaMethod, exceptionSignal, argv); + QAxBase::qt_static_metacall(that, QMetaObject::InvokeMetaMethod, + exceptionSignal - mo->methodOffset(), argv); printWarning = false; } } diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp index e4cd9b4..6fe39ea 100644 --- a/src/activeqt/control/qaxserver.cpp +++ b/src/activeqt/control/qaxserver.cpp @@ -452,6 +452,7 @@ static const char* const type_map[][2] = { "QCString", "BSTR" }, { "bool", "VARIANT_BOOL" }, { "int", "int" }, + { "void", "void" }, { "uint", "unsigned int" }, { "double", "double" }, { "QColor", "OLE_COLOR" }, |