[Development] QtRemoteObjects (was Replicant)
katreniak at gmail.com
Mon Oct 20 13:49:26 CEST 2014
What about removing the hard dependency of type safe replicas on the
rep language and rep compiler? Can we extend moc compiler?
When we write the server objects, we already have the QObject with all
the signals and slots visible for moc. Moc could generate the type
safe replica objects based on this information. This approach enables
type safe replicas for existing Qt code base.
On Fri, Oct 17, 2014 at 11:33 AM, Stottlemyer, Brett (B.S.)
<bstottle at ford.com> wrote:
> On Friday 17 October 2014 11:31:10 Sumedha Widyadharma wrote:
>> Do you think it would be possible to use run-time introspection à la QtWebChannel and dynamic signals/slots to get rid of the pre-processor?
> (see: http://doc.qt.digia.com/qq/qq16-dynamicqobject.html)
> I can't speak to QtWebChannel (trust Milian on that front), but I can speak to QtRemoteObjects. The functionality to point at has been incorporated into Qt via (private) QMetaObjectBuilder. This was a topic that was brought up at QtCS. We've incorporated the mechanism into QTRO, so you can indeed ask for an object as a Replica without using our compiler.
> This does have some implications. Compile time type-safety is certainly part of a decision to use compiled vs. dynamic Replicas. Second, the repc compiler enables default values for properties. So you have the ability show something reasonable, even if the source object isn't available. For dynamic objects, you don't even know what properties are available until the Replica can be initialized from the Source object. Third, usage from C++ is a bit trickier as well, but less of a concern from QML. Finally, certain types need to be registered for use with stream operators. We can do this with the compiled Replicas, but not with dynamically created ones. Those are the big hitters off the top of my head.
> So it really depends on the use-case whether QRemoteObjectDynamicReplica (yes, it is a mouthful - still like the old name better) is a good option over the compiled version. But the capability is already there.
> If you go the route of dynamic Replicas, you can use QObject-derived types as the Source, and avoid the repc compiler entirely.
> Development mailing list
> Development at qt-project.org
More information about the Development