Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 \l {Qt Positioning Android plugin}{Android} positioning subsystem.
19 Available only on Android.
20 \row
21 \li \b corelocation
22 \li Wraps \l {Qt Positioning Core Location plugin}{iOS and \macos}
23 positioning subsystems. Available only on Apple platforms supporting
24 corelocation.
25 \row
26 \li \b geoclue2
27 \li A \l {Qt Positioning GeoClue v2 plugin}{GeoClue v2} backend that
28 provides an interface to the GeoClue v2 D-Bus service.
29 \row
30 \li \b gypsy
31 \li A \l {Qt Positioning Gypsy plugin}{Gypsy} backend that provides
32 an interface to the Gypsy daemon.
33 \row
34 \li \b winrt
35 \li Wraps \c {Windows.Devices.Geolocation} APIs. Available on Windows.
36 \row
37 \li \b nmea
38 \li An \l {Qt Positioning NMEA plugin}{NMEA} backend that parses NMEA
39 streams from a GPS receiver to provide position updates. This plugin can
40 use serial port, socket or file as a source.
41 \row
42 \li \b wasm
43 \li Wraps Web Geolocation APIs. Available only in Qt for WebAssembly.
44 Added in Qt 6.11.
45 \row
46 \li \b ohos
47 \li Wraps HarmonyOS LocationKit APIs. Available only on HarmonyOS. Added
48 in Qt 6.12.
49 \row
50 \li \b positionpoll
51 \li A backend providing only area monitoring functionalities via polling on position updates.
52\endtable
53
54
55\section1 Plugin Description
56
57Each plugin is described by a json file. The json describes the plugins capabilities and
58version. Below is an example of a json file used by the postionpoll plugin:
59
60\quotefile ../../../plugins/position/positionpoll/plugin.json
61
62The entries have the following meaning:
63
64\table
65 \header
66 \li Key
67 \li Description
68 \row
69 \li Keys
70 \li The unique name/key of the plugin. Each position plugin must have a unique name.
71 \row
72 \li Provider
73 \li The provider name of the services. Multiple plugins may have the same name.
74 In such cases the Version string will be used to further distinguish the plugins.
75 \row
76 \li Position
77 \li Set to \c true if the plugin implements a \l QGeoPositionInfoSource.
78 \row
79 \li Satellite
80 \li Set to \c true if the plugin implements a \l QGeoSatelliteInfoSource.
81 \row
82 \li Monitor
83 \li Set to \c true if the plugin implements a \l QGeoAreaMonitorSource.
84 \row
85 \li Priority
86 \li The plugin priority. If multiple plugins have the same provider name, the plugin
87 with the higest priority will be used.
88\endtable
89
90\section1 Implementing Plugins
91
92A plugin implementer needs to subclass \l QGeoPositionInfoSourceFactory and override one or more of
93its functions. If a plugin does not support a specific feature the function should return 0 or
94utilize the default implementation.
95
96\list
97 \li \l QGeoPositionInfoSourceFactory::areaMonitor()
98 \li \l QGeoPositionInfoSourceFactory::positionInfoSource()
99 \li \l QGeoPositionInfoSourceFactory::satelliteInfoSource()
100\endlist
101*/