QtProtobuf
0.6
Protobuf plugin to generate Qt classes
|
Provides support of native Qt types.
Provides support of native Qt types.
Like Google Protocol Buffers provide bench of standard types, QtProtobuf give you possibility to use Qt types directly in your projects. QtProtobufQtTypes library makes this possible.
List of supported types:
To enable Qt types support add ProtobufQtTypes as dependency to CMake project:
Starting from this point you are almost complete preparation. Unlike automatical registration of generated code, QtProtobufQtTypes requires additional intialization step. Before any serialization/deserialization of messages that use Qt types as fields, call registration method:
All supported message are described in special .proto files:
These files also useful if you would like to generate code for other languages or frameworks. They located in project include directories, but no need to specify anything manualy, qtprotobuf_generate macro takes care about all side work for you.
Import required Qt types module in your interface .proto file, e.g.:
QtProtobuf generator detects fields of type is located in QtProtobuf package and use Qt type directly instead of complex message generation. This give you flexibility to use Qt types without additional convertion steps.
In generated code you will see following property ready to use: