本页内容

GrpcChannelOptions QML Type

GrpcChannelOptions 是一个用于设置额外通道选项的存储类。更多内容...

Import Statement: import QtGrpc
Since: Qt 6.7
In C++: QGrpcChannelOptions

属性

详细说明

提供了一组属性,用于访问 gRPC™ 通道用于与服务通信的选项。

另请参阅 QGrpcChannelOptions 。

属性文档

deadlineTimeout : int

为通道设置截止时间值。

另请参阅 QGrpcChannelOptions::deadlineTimeout 。

metadata : GrpcMetadata

设置指向某个频道所用元数据对象的指针。

另请参阅 GrpcMetadata 。

serializationFormat : enumeration [since 6.8]

设置通道的序列化格式。默认使用QtGrpc::SerializationFormat::Default 格式。

常量描述
QtGrpc.SerializationFormat.Default默认的QGrpcSerializationFormat 预设。该预设会构建一个内容类型后缀为空的QProtobufSerializer 。
QtGrpc.SerializationFormat.Protobuf嵌入式 ProtobufQGrpcSerializationFormat 预设。该预设会构建一个内容类型后缀为proto 的QProtobufSerializer 。
QtGrpc.SerializationFormat.Json嵌入式 JSON 预设QGrpcSerializationFormat 。该预设会构建一个内容类型后缀为json 的QProtobufJsonSerializer 。

该属性在 Qt 6.8 中引入。

另请参阅 QGrpcChannelOptions::serializationFormat 、QtGrpc::SerializationFormat 和QGrpcSerializationFormat 。

© 2026 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.