Qt Positioning Plugins

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

Default plugins

Some plugins already ship with Qt. These are:

androidWraps Android positioning subsystem. Available only on Android.
corelocationWraps iOS and macOS positioning subsystems. Available only on Apple platforms supporting corelocation.
geoclue2A GeoClue v2 backend that provides an interface to the GeoClue v2 D-Bus service.
gypsyA Gypsy backend that provides an interface to the Gypsy daemon.
winrtWraps WinRT positioning subsystem. Available only on WinRT and Windows10.
nmeaAn 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.
positionpollA 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:

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

The entries have the following meaning:

KeyDescription
KeysThe unique name/key of the plugin. Each position plugin must have a unique name.
ProviderThe 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.
PositionSet to true if the plugin implements a QGeoPositionInfoSource.
SatelliteSet to true if the plugin implements a QGeoSatelliteInfoSource.
MonitorSet to true if the plugin implements a QGeoAreaMonitorSource.
PriorityThe 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.

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