PluginParameter QML Type
PluginParameter 类型描述了位置插件的一个参数。更多内容...
| Import Statement: | import QtPositioning |
| Since: | QtPositioning 5.14 |
属性
详细说明
PluginParameter 对象用于向插件提供某种类型的参数。通常,这些参数包含诸如访问服务的应用程序令牌、用于网络访问的代理服务器,或是连接串行 GPS 接收器的串行端口等详细信息。
要设置此类参数,请在支持将插件参数作为配置对象的元素(例如PositionSource 对象)内部声明一个PluginParameter,并为其name 和value 属性设置值。各插件的有效参数名称列表可在定位插件的默认插件页面中查阅。
使用示例
以下示例展示了NMEA插件的实例化过程,其中nmea.source参数用于指定数据源。
PositionSource {
name: "nmea"
PluginParameter { name: "nmea.source"; value: "serial:/dev/ttyACM0" }
}属性文档
name : string
该属性以单个格式化字符串的形式存储插件参数的名称。该属性为仅写入一次的属性。
value : QVariant
该属性存储插件参数的值,该参数支持多种类型的值(变体)。该属性为“仅写入一次”属性。
© 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.