Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qtpositioning-plugins.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qtpositioning-plugins.html
6\title Qt Positioning Plugins
7\brief Default Plugins and Implementing Qt Positioning plugins
8
9Qt Positioning provides the majority of its functionality through plugins.
10This document outlines how to develop a new position plugin.
11
12\section1 Default plugins
13Some plugins already ship with Qt. These are:
14
15\table
16 \row
17 \li \b android
18 \li Wraps Android positioning subsystem. Available only on Android.
19 \row
20 \li \b corelocation
21 \li Wraps iOS and macOS positioning subsystems. Available only on Apple platforms supporting corelocation.
22 \row
23 \li \b geoclue2
24 \li A \l {Qt Positioning GeoClue v2 plugin}{GeoClue v2} backend that
25 provides an interface to the GeoClue v2 D-Bus service.
26 \row
27 \li \b gypsy
28 \li A \l {Qt Positioning Gypsy plugin}{Gypsy} backend that provides
29 an interface to the Gypsy daemon.
30 \row
31 \li \b winrt
32 \li Wraps WinRT positioning subsystem. Available only on WinRT and Windows10.
33 \row
34 \li \b nmea
35 \li An \l {Qt Positioning NMEA plugin}{NMEA} backend that parses NMEA
36 streams from a GPS receiver to provide position updates. This plugin can
37 use serial port, socket or file as a source.
38 \row
39 \li \b positionpoll
40 \li A backend providing only area monitoring functionalities via polling on position updates.
41\endtable
42
43
44\section1 Plugin Description
45
46Each plugin is described by a json file. The json describes the plugins capabilities and
47version. Below is an example of a json file used by the postionpoll plugin:
48
49\quotefile ../../../plugins/position/positionpoll/plugin.json
50
51The entries have the following meaning:
52
53\table
54 \header
55 \li Key
56 \li Description
57 \row
58 \li Keys
59 \li The unique name/key of the plugin. Each position plugin must have a unique name.
60 \row
61 \li Provider
62 \li The provider name of the services. Multiple plugins may have the same name.
63 In such cases the Version string will be used to further distinguish the plugins.
64 \row
65 \li Position
66 \li Set to \c true if the plugin implements a \l QGeoPositionInfoSource.
67 \row
68 \li Satellite
69 \li Set to \c true if the plugin implements a \l QGeoSatelliteInfoSource.
70 \row
71 \li Monitor
72 \li Set to \c true if the plugin implements a \l QGeoAreaMonitorSource.
73 \row
74 \li Priority
75 \li The plugin priority. If multiple plugins have the same provider name, the plugin
76 with the higest priority will be used.
77\endtable
78
79\section1 Implementing Plugins
80
81A plugin implementer needs to subclass \l QGeoPositionInfoSourceFactory and override one or more of
82its functions. If a plugin does not support a specific feature the function should return 0 or
83utilize the default implementation.
84
85\list
86 \li \l QGeoPositionInfoSourceFactory::areaMonitor()
87 \li \l QGeoPositionInfoSourceFactory::positionInfoSource()
88 \li \l QGeoPositionInfoSourceFactory::satelliteInfoSource()
89\endlist
90*/