summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-10-20 18:03:11 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-10-21 06:44:02 +0000
commit201d40e4daafa7fd6f2d8f4237f393847550052d (patch)
tree93415ef02f133e302136870ad683e9da0c0cf0de /src
parentf735057e8b5b92f8b744a1d8d22e2c5e355ee20f (diff)
Fix returning QAxServer objects from methods
A QVariant initialized from a QMetaType is valid, but null, so in case of pointer return types we didn't update the QVariant that would then be written back into the return value. Always write back if we have previously recognized that we are dealing with a pointer return type, indicated by argv[0] pointing at the argv_pointer array. Task-number: QTBUG-106024 Pick-to: 6.4 Change-Id: Ic1bd258b006746e0233c09fe68842bdeefdfc84f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/activeqt/control/qaxserverbase.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index a7675ef..e13a5df 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -2502,9 +2502,8 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
}
if (!type.isEmpty() && type != "void" && pvarResult) {
- if (!varp[0].isValid() && type != "QVariant")
+ if (argv[0] == argv_pointer && type != "QVariant")
varp[0] = QVariant(QMetaType::fromName(type), argv_pointer);
-// varp[0].setValue(argv_pointer[0], type);
ok = QVariantToVARIANT(varp[0], *pvarResult, type);
}
}