Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.0 FF
-
None
Description
Considering a slot Foo::bar(SomeQObject*), QMetaMethod::invoke() cannot call this with a QGenericArgument of type QObject* anymore, even though the QObject* in question actually has the correct type.
This has worked before and is a regression in Qt 6.5. The regression has been introduced by commit a1c34d8bd09bfc6e80dcb06c7900d40c2d32518c ("QMetaObject: rewrite QMetaMethod::invoke") in qtbase. This causes autotests in QtWebChannel to fail. See QTBUG-105596 in particular:
QWARN : TestWebChannel::testPassWrappedObjectBack() QMetaMethod::invoke: cannot convert formal parameter 0 from QObject* in call to TestObject::setReturnedObject(TestObject*) FAIL! : TestWebChannel::testPassWrappedObjectBack() Compared QObject pointers are not the same Actual (registeredObj.mReturnedObject): <null> Expected (&returnedObjMethod) : TestObject/0x7ffdd386cd50 Loc: [../qtwebchannel/tests/auto/webchannel/tst_webchannel.cpp(916)]
Is this behavior intended? The documentation makes no guarantees about implicitly converting QObject* pointers. Considering that we hit this in one of our own modules, I'd say it's likely that user code will be affected as well.
Attachments
Issue Links
- resulted in
-
QTBUG-105596 FAIL! : TestWebChannel::testPassWrappedObjectBack() Compared QObject pointers are not the same
-
- Closed
-