[Development] Switch Qt Remote Objects to a Tech Preview for Qt 5.9
Stottlemyer, Brett (B.S.)
bstottle at ford.com
Wed Jan 11 09:48:30 CET 2017
On 1/10/17, 7:42 PM, "Stottlemyer, Brett (B.S.)" <bstottle at ford.com> wrote:
>On 1/10/17, 7:11 AM, "Development on behalf of Oswald Buddenhagen" <development-bounces+bstottle=ford.com at qt-project.org on behalf of oswald.buddenhagen at qt.io> wrote:
>
>>you mostly lost me here, because i just don't know enough about the data
>>flows of the qtro build system, so it would be helpful if you outlined
>>that.
...
>*QtRO will do type checking at compile time if an API gets generated from
>repc.
Maybe it is worth expanding on this a little bit. If you are using QtRO from
the beginning of a project, the idea would be for the owner of an interface
to define the API their object will use in a .rep file. In the .pro file,
REPC_SOURCE += someInterface.rep is added, which causes repc to generate the
Source side header file, which provides a QObject class for that API with
pure virtual methods for Slots. The developer then inherits from the base
API class and implements the internal logic to meet the API. Side note:
additional Qt Signals/Slots can be added to the derived class, which aren’t
exposed to Replicas if they aren’t in the .rep file.
Anyone that wants to use this interface would add
REPC_REPLICA += someInterface
to their .pro file, which generates (you guessed it) the Replica side header
file. It is possible to inherit from this class, but usually isn’t necessary
and the class/code can be used directly.
The reason for having moc code as part of repc is to handle the use-case of
someone having an already developed QObject type and wanting to use that
with QtRO. I.e., a class that doesn’t derive from the auto generated
Source class. In this case, moc is used to parse the header, and generate
the .rep for your class. The .rep file can then be used by clients to
get Replicas.
There is another level of detail in QtRO for efficiency and type safety (see
the auto generated someInterfaceSourceAPI template in the Source header).
Feel free to look at that if you want more detail.
Regards,
Brett
More information about the Development
mailing list