Qt定位插件

Qt Positioning Plugins

Qt定位插件

Qt Positioning provides the majority of its functionality through plugins. This document outlines how to develop a new position plugin.

Qt定位通过插件提供其大部分功能。本文档概述了如何开发新的位置插件。

Default plugins

默认插件

Some plugins already ship with Qt. These are:

Qt已经附带了一些插件。这些是:

android

Wraps Android positioning subsystem. Available only on Android.

​封装Android定位子系统。仅在Android上可用。

corelocation

Wraps iOS and macOS positioning subsystems. Available only on Apple platforms supporting corelocation.

封装iOS和macOS定位子系统。仅在支持核心定位的苹果平台上可用。

geoclue2

GeoClue v2 backend that provides an interface to the GeoClue v2 D-Bus service.


GeoClue v2后端,为GeoClue v2 D-Bus服务提供接口。

gypsy

Gypsy backend that provides an interface to the Gypsy daemon.

​Gypsy后端,为Gypsy守护进程提供接口。​

winrt

Wraps WinRT positioning subsystem. Available only on WinRT and Windows10.

封装WinRT定位子系统。仅在WinRT和Windows10上可用。

nmea

An NMEA backend that parses NMEA streams from a GPS receiver to provide position updates. This plugin can use serial port, socket or file as a source.

​NMEA后端,解析来自GPS接收器的NMEA流以提供位置更新。此插件可以使用串行端口、套接字或文件作为源。

positionpoll

A backend providing only area monitoring functionalities via polling on position updates.

后端仅通过位置更新轮询提供区域监控功能。

Plugin Description

插件说明

Each plugin is described by a json file. The json describes the plugins capabilities and version. Below is an example of a json file used by the postionpoll plugin:

每个插件都由一个json文件描述。json描述了插件的功能和版本。以下是postionpoll插件使用的json文件示例:

{
    "Keys": ["positionpoll"],
    "Provider": "positionpoll",
    "Position": false,
    "Satellite": false,
    "Monitor": true,
    "Priority": 1000,
    "Testable": true
}

The entries have the following meaning:

这些条目具有以下含义:

KeyDescription
Keys

The unique name/key of the plugin. Each position plugin must have a unique name.

插件的唯一名称/密钥。每个位置插件都必须有一个唯一的名称。

Provider

The provider name of the services. Multiple plugins may have the same name. In such cases the Version string will be used to further distinguish the plugins.

插件的唯一名称/密钥。每个位置插件都必须有一个唯一的名称。

Position

Set to true if the plugin implements a QGeoPositionInfoSource.

​如果插件实现了QGeoPositionInfoSource,则设置为true。​

Satellite

Set to true if the plugin implements a QGeoSatelliteInfoSource.


如果插件实现了QGeoSatelliteInfoSource,则设置为true。

Monitor

Set to true if the plugin implements a QGeoAreaMonitorSource.


如果插件实现了QGeoAreaMonitorSource,则设置为true。

Priority

The plugin priority. If multiple plugins have the same provider name, the plugin with the higest priority will be used.

插件优先级。如果多个插件具有相同的提供者名称,则将使用优先级最高的插件。

Implementing Plugins

实现插件

A plugin implementer needs to subclass QGeoPositionInfoSourceFactory and override one or more of its functions. If a plugin does not support a specific feature the function should return 0 or utilize the default implementation.

​插件实现者需要子类化QGeoPositionInfoSourceFactory并覆盖其一个或多个函数。如果插件不支持特定功能,则函数应返回0或使用默认实现。

iOS supportAndroid plugin

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值