On Tuesday, October 21, 2014 8:19 AM Simon Hausmann wrote:
> The QTime is literally the result of string copy&paste from the token in the 
> header file into the moc generated C++ code. 
> There's no type lookup, resolution or analysis involved :)

But that's the point, isn't it?  The type itself needs to be sufficient for 
generating the protocol buffer.  MOC is relying on the fact the Qt knows how to 
copy objects of type QTime, and serialize them.  The code I pasted doesn't know 
what QTime is, but it is described in the QTime code generated when MOC runs on 
the QTime header.  It relies on introspection being available, and generates 
the code necessary for introspection as it runs against the Qt codebase.  

Unless you expect the end user to manually write the protocol buffer, the exact 
same process of breaking down objects is needed for remote objects.  How else 
can I automatically generate a protocol buffer for QTime (or any arbitrarily 
complex QObject)?  The objects need to be self-describing, which is what MOC 
gives us.

Again, I like the idea of remote objects working outside of Qt.  Yes, protocol 
buffers are self-describing, but that is because there is a template.  You 
haven't solved the problem, you've just moved it.  You still need to generate 
the template.  Something needs to know how to serialize/marshal a QTime when it 
sees one.  And the repc compiler is the same as MOC in that sense.  It just 
grabbed the string "QTime".

Brett
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to