Important: Please read the Qt Code of Conduct -

Qt Remote Objects

  • As Qt Remote Objects are a supported module in Qt 5.12.x I started to look into it.

    I generated a Qt Remote Source node from a .rep file

    class StatusServer
    // currState hold the current state of the RemoteObject
    PROP(int protVersion);
    // have a list of announced services
    PROP(QList<QString> announcedServices);

    and was looking at the generated code.

    To identify the generated Remote Source the remote object compiler generated source files (one the remote source and one for the replica).
    In both header files the generated classes have identical Q_CLASSINFO entries:

    Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_SIGNATURE, "5ea31b1c42f2d4fafeb9e0a70660afb5956ea064")

    OK, one is the name that was use for the class in the .repfile.
    The other one is more interesting: a signature.
    Well, what is this signature for and how is this generated -- or better: what are the relevant parameters, that define the signature.

    Therefore I played around with the rep file and check, when it changes the signature.

    First I made something 'stupid' and copied the rep file to the source of the client software using the Replica. (Well, it would be better to use the same rep file, but anyway it is not clear, if the client source is compiled at the same time and with the same version of Qt as the Remote Source).

    • Swapping the PROP order -> changes the signature
    • using qint32 instead of int in the protVersion prop (under Windows int is the definition of qint32) -> changes the signature
    • appending a new PROP -> changes the signature

    Well, I did not find any description about the signature.
    I found out, that, if the replica uses a rep file with the same QCLASSINFO_REMOTEOBJECT_TYPE but with a different QCLASSINFO_REMOTEOBJECT_SIGNATURE, then during runtime I get a warning in the Application output pane:

    qt.remoteobjects:  Signature mismatch for StatusServerReplica "StatusServer"

    Well, good so.

    I think some words about versioning the rep interface should be noted somewhere.
    Did I just not find it?

    What do I have to deploy, if I create a Remote Object Source as compiled server.

    • Is the .rep file enough?
    • Do I have to note the Qt Version -- will the Signature change, if I use Qt 5.13.x, Qt 6.x.y, ...

    Where can I find these info?

Log in to reply