diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-01-07 11:54:15 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-01-15 11:52:18 +0100 |
commit | 37f55a5b3be480a8b6ef405bf162dc8015e971b0 (patch) | |
tree | 2fc4c2efebbad0482feb624972bc3c09d0eed4ca | |
parent | 2a484f4c3d23d8b9fdaa381696251736d5d3da10 (diff) |
Fix invocation of QVariant-return type verbs.
Detect QMetaType::QVariant as QVariant.
Task-number: QTBUG-43446
Change-Id: Ib1911e79b62b241e01374586321a934303e705fa
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 2150361..c4cae79 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -2463,19 +2463,18 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid, // return value if (!type.isEmpty() && type != "void") { QVariant::Type vt = QVariant::nameToType(type); - if (vt == QVariant::UserType) - vt = QVariant::Invalid; - varp[0] = QVariant(vt); - if (varp[0].type() == QVariant::Invalid && mo->indexOfEnumerator(slot.typeName()) != -1) - varp[0] = QVariant(QVariant::Int); - - if (varp[0].type() == QVariant::Invalid) { - if (type == "QVariant") - argv[0] = varp; - else - argv[0] = 0; + if (vt == int(QMetaType::QVariant)) { + argv[0] = varp; } else { - argv[0] = const_cast<void*>(varp[0].constData()); + if (vt == QVariant::UserType) + vt = QVariant::Invalid; + else if (vt == QVariant::Invalid && mo->indexOfEnumerator(slot.typeName()) != -1) + vt = QVariant::Int; + varp[0] = QVariant(vt); + if (varp[0].type() == QVariant::Invalid) + argv[0] = Q_NULLPTR; + else + argv[0] = const_cast<void*>(varp[0].constData()); } if (type.endsWith('*')) { argv_pointer[0] = argv[0]; |