Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.2
Description
Reproducer attached. It contains an ActiveX server that adepts from Simple Example (ActiveQt) and an ActiveX container. The server is mostly identical to the example except one additional method:
bool setSomethingComplicated(QSimpleAX *complicatedThing) { qInfo("I was called with a complicated thing."); return true; }
which is the problem, i.e. its argument is of type QSimpleAX.
To reproduce the issue, one need to:
- Build the server (/simple) and register it
- Run dumpcpp on the simpleax.exe and get a header and a source
- Copy the header and the source into container project (/usesimple) and do some modifications:
- In the header, remove all Qt types (QRect, QPoint, QSize, etc..) from namespace and replace all "simpleaxLib::QtType" with just ""QtType". That is by another bug: https://bugreports.qt.io/browse/QTBUG-134098
- Comment out everything related to method"setVisible". That is an ugly but quick fix for the problem that both ActiveQt and QWidget provide "setVisible" method - different but with the same name.
- Build and run the container
First, one is going to see the dialog from "about()", which means QSimpleAx itself is largely fine. Then on will see an error:
QAxBase: Error calling IDispatch member setSomethingComplicated: Type mismatch in parameter 0
from "setSomethingComplicated()" method call.
And the problem can be tracked down to qaxbase.cpp:
That when Qt is doing "internalInvoke", the signature of the method is obtained as
"setSomethingComplicated(QSimpleAX*)"
which is clearly not true. The correct signature is:
setSomethingComplicated(simpleaxLib::QSimpleAX*)
So obviously, QSimplexAx is not wrapped in its custom namespace.
And according to the original reporter that "qRegisterMetaType<simpleaxLib::QSimpleAX *>();" (but strangely not by Q_DECLARE_METATYPE) can help solve the problem (by uncommenting the "DEFINES += FIX_TYPEMISMATCH" in container.pro file). However, I can't make it work in either way.