Fix handling of out-parameters that are of VARIANT-type


Qt knows about QVariant as a built-in meta type, QMetaType::QVariant. It
is no longer mapped to user type. COM objects expect that untyped out-
parameters, which are mapped to QVariant& by ActiveQt, are passed in as
VT_VARIANT|VT_BYREF.

Update our variant-conversion logic accordingly. If the typeName, which
comes from the generated function signature, is "QVariant", then
QMetaType::fromName(typeName) will always be QMetaType::QVariant, and
had to be passed as VT_VARIANT.

Fix the logic for deciding whether we have to write back the out-
parameters so that it works when QAxScript::call is used. We need to
write back no matter whether it's a property or a getter, so check
whether any bit is set, not if both are set.

Add some test for this. Not cherry-picking this further back, the
auto-test coverage of ActiveQt is not good enough to make sure that we
don't break any subtle usecases in e.g. QAxServer, and the usage of
QAxScript does not seem to be very wide.

Fixes: QTBUG-111718
Pick-to: 6.5
Change-Id: I239f71c3637ea9f32dff5123a8ada96e0a894371
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
commite640503b65c4d786edc9f005a1c3f6f66e87793d
parent4e1e7938763b5b8323c5e437286ccccd31d95156
authorVolker Hilsheimer <volker.hilsheimer@qt.io>
committerVolker Hilsheimer <volker.hilsheimer@qt.io>
commit timeWed, 22 Mar 2023 17:37:19 +0100