本页内容

GrpcMetadata QML Type

GrpcMetadata 是一个将元数据存储在无序多映射(multimap)容器中的类。更多内容...

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"})
}

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