PluginParameter QML Type

PluginParameter 类型描述了位置插件的参数。更多

Import Statement: import QtPositioning
Since: QtPositioning 5.14

属性

详细说明

PluginParameter 对象用于为插件提供某种参数。通常,这些参数包含一些细节,如用于访问服务的应用程序令牌、用于网络访问的代理服务器或连接串行 GPS 接收器的串行端口。

要设置此类参数,可在接受插件参数作为配置对象(如PositionSource 对象)的元素内声明 PluginParameter,并为其namevalue 属性设置值。每个插件的有效参数名称列表可从位置插件的默认插件页面获取。

使用示例

下面的示例显示了NMEA插件的实例化,其中的nmea.source参数指定了数据源。

PositionSource {
    name: "nmea"
    PluginParameter { name: "nmea.source"; value: "serial:/dev/ttyACM0" }
}

属性文档

name : string

该属性以格式化字符串形式保存插件参数的名称。此属性为写入即用属性。


value : QVariant

该属性包含插件参数的值,支持不同类型的值(变量)。此属性为只写属性。


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