Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.6.1
-
None
Description
According to this part of the RemoteObjects documentation https://doc.qt.io/qt-6/qtremoteobjects-source.html#identifying-sources
The name under which that remoteobject is made public on the registry is chosen by that order stated in the documentation.
I customized my repc like followed:
repcodegenerator.cpp
if (mode != SIMPLE_SOURCE) { // m_stream << " Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, \"" // << astClass.name << "\")" << Qt::endl; // m_stream << " Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_SIGNATURE, \"" // << QLatin1String(classSignature(astClass)) << "\")" << // Qt::endl;
After that I tried using the registry like followed:
QString id = QUuid::createUuid().toString(); bool rslt = p.data()->enableRemoting(&obj, id);
and like so
QString id = QUuid::createUuid().toString(); obj.setObjectName(QStringLiteral("%1-%2")).arg("ExampleClass",id)); bool rslt = p.data()->enableRemoting(&obj);
Both versions result in the error
qt.remoteobjects: Invalid method invoke packet received. Index = 0 which is out of bounds for type "ExampleClass-{6dd0a02e-50b0-446f-b264-0808b757e507}"
After reverting the changes made in repc it works again. Specifically
Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, \""
<< astClass.name << "\")" << Qt::endl;
makes it work