Qt Protobuf
generator plugin
generates Qt-based classes from
.proto
files. You can use the classes to serialize and deserialize their associated protobuf messages.
Protocol buffers are a language-neutral, platform-neutral, and extensible mechanism for serializing structured data, which is compact and easy to use:
.proto
文件。
.proto
files to generate code in various programming languages.
The provided format is suitable for network traffic or long-term data storage.
Protocol buffers provide a serialization format for packets of typed and structured data that are up to a few megabytes in size. Moreover, it can be extended with new information without invalidating existing data or requiring code to be updated. For more information, see Protocol Buffers Overview .
You can use a Protocol buffers mechanism in any Qt-based project:
Google protocol buffers provide a generator called
protoc
that supports extensions.
The qtprotobufgen Tool
is an extension for
protoc
and requires that you install
protoc
on your host system. For more information about the installation, see
Protoc Installation
.
Example of installation for Linux, using apt :
apt install -y protobuf-compiler protoc --version # Ensure compiler version is 3+
For more information about component API usage, see CMake API .