GrpcMetadata QML Type

GrpcMetadata 是一个在无序多地图容器中存储元数据的类。更多

Import Statement: import QtGrpc
Since: Qt 6.7

属性

  • data : QVariantMap

详细说明

元数据是关于特定 gRPC调用或通道的信息(如身份验证详情),其形式是键值对列表,其中键是字符串,值通常是字符串,但也可以是二进制数据。该类提供了在无序容器中存储数据的可能性。此外,还可以用同一个键存储多个值。

注意: 使用逗号符号可通过同一键设置多个值。

属性文档

data : QVariantMap

提供对元数据容器的访问,并在 QML 中以QVariantMap 格式设置。

注意: 数据是REQUIRED 属性。创建对象时必须设置它。

注意: 使用逗号符号可通过同一键设置多个值。请参阅下面的示例:

GrpcMetadata {
    id: grpcData
    data: ({ "user-name": "localhost, remotehost",
            "user-password": "qwerty, 123456"})
}

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