Qt Protobuf Well-Known Types C++ Classes
Qt Protobuf Well-Known Types 模块为Well-Known Types包中的部分类型提供支持。更多
该模块在 Qt 6.6 中引入。
类
用于简化 protobuf Any 类型操作的辅助类 |
详细描述
QtProtobufWellKnownTypes 包含以下Protobuf Well-Known 类型:支持的类型:
- Any(消息)
- Api(消息)
- BoolValue(消息)
- BytesValue(信息)
- DoubleValue(信息)
- Duration(信息)
- 空(信息)
- 枚举(信息)
- EnumValue(信息)
- 字段(信息)
- Field.Cardinality(枚举)
- Field.Kind(枚举)
- FieldMask(信息)
- FloatValue(信息)
- Int32Value(信息)
- Int64Value(信息)
- ListValue(信息)
- 方法(信息)
- Mixin(消息)
- NullValue(枚举)
- Option (选项)
- SourceContext (源上下文)
- StringValue (字符串值)
- 结构体(消息)
- 语法(枚举)
- 时间戳(信息)
- 类型(信息)
- UInt32Value(信息)
- UInt64Value(信息)
- 值(消息)
要在项目中使用知名类型,您可以在界面中包含相应的 google .proto 文件:
syntax = "proto3"; package somepackage; import "google/protobuf/any.proto"; message Message { google.protobuf.Any payload = 1; }
要使用列出的类型,您必须在CMakeLists.txt文件中添加以下一行,与QtProtobuf WellKnownTypes 库链接:
target_link_libraries(YourTargetName PRIVATE Qt::ProtobufWellKnownTypes)
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.