Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.0
-
None
Description
In Qt Remote Objects, some types are not marshalled correctly when used as return values from a SLOT, even though those types are correctly marshalled when used as parameters.
Specifically, my problem is with standard C++ integral types (int32_t, size_t, etc) but I suspect the issue is larger.
Minimal example:
In .rep
class Foo {
SLOT(uint32_t foo(uint32_t value))
}
Source implementation
uint32_t FooImpl::foo(uint32_t value) {
qDebug() << value; // OK, prints 44
return 42;
}
Replica usage
auto reply = replica->foo(44);
reply.waitForFinished();
qDebug() << reply.returnValue(); // NOT OK: prints 0, should be 42
After examination, the QVariant in QRemoteObjectPendingCall is invalid.
If I change the .rep to read:
SLOT(unsigned int foo(uint32_t value))
and without changing anything else (which compiles fine because unsigned int and uint32_t are the same on my platform), the return value is now correctly marshalled.