Qt Protobuf Well-Known Types C++ Classes

The Qt Protobuf Well-Known Types module provides support for some of the types available from the Well-Known Types package. 更多...

This module is in Technical Preview 状态。

This module was introduced in Qt 6.6.

QtProtobuf::Any

A helper class to simplify working with the protobuf Any type

详细描述

QtProtobufWellKnownTypes contains the following Protobuf Well-Known types : Supported types:

  • 任何

To use well-known type in your project you may include the corresponding google .proto file in your interface:

syntax = "proto3";
package somepackage;
import "google/protobuf/any.proto";
message Message {
    google.protobuf.Any payload = 1;
}
										

To use the types listed you must link with the QtProtobuf WellKnownTypes library by adding the following line to your CMakeLists.txt 文件:

target_link_libraries(YourTargetName PRIVATE Qt::ProtobufWellKnownTypes)