Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qgeopositioninfosource.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
#
include
<
qgeopositioninfosource
.
h
>
5
#
include
"qgeopositioninfosource_p.h"
6
#
include
"qgeopositioninfosourcefactory.h"
7
8
#
include
<
QFile
>
9
#
include
<
QPluginLoader
>
10
#
include
<
QStringList
>
11
#
include
<
QCryptographicHash
>
12
#
include
<
QtCore
/
private
/
qfactoryloader_p
.
h
>
13
#
include
<
QtCore
/
private
/
qthread_p
.
h
>
14
15
#
include
<
algorithm
>
16
17
QT_BEGIN_NAMESPACE
18
19
Q_GLOBAL_STATIC_WITH_ARGS
(QFactoryLoader, loader,
20
(
"org.qt-project.qt.position.sourcefactory/6.0"
,
21
QLatin1String(
"/position"
)))
22
23
/*!
24
\class QGeoPositionInfoSource
25
\inmodule QtPositioning
26
\ingroup QtPositioning-positioning
27
\since 5.2
28
29
\brief The QGeoPositionInfoSource class is an abstract base class for the distribution of positional updates.
30
31
The static function QGeoPositionInfoSource::createDefaultSource() creates a default
32
position source that is appropriate for the platform, if one is available.
33
Otherwise, QGeoPositionInfoSource will check for available plugins that
34
implement the QGeoPositionInfoSourceFactory interface.
35
36
Users of a QGeoPositionInfoSource subclass can request the current position using
37
requestUpdate(), or start and stop regular position updates using
38
startUpdates() and stopUpdates(). When an update is available,
39
positionUpdated() is emitted. The last known position can be accessed with
40
lastKnownPosition().
41
42
If regular position updates are required, setUpdateInterval() can be used
43
to specify how often these updates should be emitted. If no interval is
44
specified, updates are simply provided whenever they are available.
45
For example:
46
47
\code
48
// Emit updates every 10 seconds if available
49
QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(0);
50
if (source)
51
source->setUpdateInterval(10000);
52
\endcode
53
54
To remove an update interval that was previously set, call
55
setUpdateInterval() with a value of 0.
56
57
\note The position source may have a minimum value requirement for
58
update intervals, as returned by minimumUpdateInterval().
59
60
\note To use this class from Android service, see
61
\l {Qt Positioning on Android}.
62
*/
63
64
/*!
65
\enum QGeoPositionInfoSource::PositioningMethod
66
Defines the types of positioning methods.
67
68
\value NoPositioningMethods None of the positioning methods.
69
\value SatellitePositioningMethods Satellite-based positioning methods such as GPS or GLONASS.
70
\value NonSatellitePositioningMethods Other positioning methods such as 3GPP cell identifier or WiFi based positioning.
71
\value AllPositioningMethods Satellite-based positioning methods as soon as available. Otherwise non-satellite based methods.
72
*/
73
74
QGeoPositionInfoSourcePrivate::~QGeoPositionInfoSourcePrivate()
75
{
76
77
}
78
79
QGeoPositionInfoSourceFactory *QGeoPositionInfoSourcePrivate::loadFactory(
const
QCborMap &meta)
80
{
81
const
int
idx =
static_cast
<
int
>(meta.value(QStringLiteral(
"index"
)).toDouble());
82
if
(idx < 0)
83
return
nullptr
;
84
QObject *instance = loader()->instance(idx);
85
if
(!instance)
86
return
nullptr
;
87
return
qobject_cast<QGeoPositionInfoSourceFactory *>(instance);
88
}
89
90
QMultiHash<QString, QCborMap> QGeoPositionInfoSourcePrivate::plugins(
bool
reload)
91
{
92
static
QMultiHash<QString, QCborMap> plugins;
93
static
bool
alreadyDiscovered =
false
;
94
95
if
(reload ==
true
)
96
alreadyDiscovered =
false
;
97
98
if
(!alreadyDiscovered) {
99
loadPluginMetadata(plugins);
100
alreadyDiscovered =
true
;
101
}
102
return
plugins;
103
}
104
105
static
bool
pluginComparator
(
const
QCborMap &p1,
const
QCborMap &p2)
106
{
107
const
QString prio = QStringLiteral(
"Priority"
);
108
QCborValue v1 = p1.value(prio);
109
QCborValue v2 = p2.value(prio);
110
bool
p1IsNumeric = v1.isInteger() || v1.isDouble();
111
bool
p2IsNumeric = v2.isInteger() || v2.isDouble();
112
if
(p1IsNumeric != p2IsNumeric)
113
return
p1IsNumeric;
// the one that has a numeric priority sorts first
114
return
(p1.value(prio).toDouble() > p2.value(prio).toDouble());
115
}
116
117
QList<QCborMap> QGeoPositionInfoSourcePrivate::pluginsSorted()
118
{
119
QList<QCborMap> list = plugins().values();
120
std::stable_sort(list.begin(), list.end(), pluginComparator);
121
return
list;
122
}
123
124
void
QGeoPositionInfoSourcePrivate::loadPluginMetadata(QMultiHash<QString, QCborMap> &plugins)
125
{
126
QFactoryLoader *l = loader();
127
QList<QPluginParsedMetaData> meta = l->metaData();
128
for
(qsizetype i = 0; i < meta.size(); ++i) {
129
QCborMap obj = meta.at(i).value(QtPluginMetaDataKeys::MetaData).toMap();
130
const
QLatin1String testableKey(
"Testable"
);
131
if
(!obj.value(testableKey).toBool(
true
)) {
132
static
bool
inTest = qEnvironmentVariableIsSet(
"QT_QTESTLIB_RUNNING"
);
133
if
(inTest)
134
continue
;
135
}
136
obj.insert(QLatin1String(
"index"
),
static_cast
<qint64>(i));
137
plugins.insert(obj.value(QStringLiteral(
"Provider"
)).toString(), obj);
138
}
139
}
140
141
/*!
142
Creates a position source with the specified \a parent.
143
*/
144
145
QGeoPositionInfoSource::QGeoPositionInfoSource(QObject *parent)
146
: QObject(*
new
QGeoPositionInfoSourcePrivate, parent)
147
{
148
qRegisterMetaType<QGeoPositionInfo>();
149
}
150
151
/*!
152
Destroys the position source.
153
*/
154
QGeoPositionInfoSource::~QGeoPositionInfoSource()
155
{
156
}
157
158
/*!
159
\property QGeoPositionInfoSource::sourceName
160
\brief This property holds the unique name of the position source
161
implementation in use.
162
163
This is the same name that can be passed to createSource() in order to
164
create a new instance of a particular position source implementation.
165
*/
166
QString QGeoPositionInfoSource::sourceName()
const
167
{
168
Q_D(
const
QGeoPositionInfoSource);
169
return
d->sourceName;
170
}
171
172
/*!
173
Sets the backend-specific property named \a name to \a value.
174
Returns \c true on success, \c false otherwise.
175
Backend-specific properties can be used to configure the positioning subsystem behavior
176
at runtime.
177
Supported backend-specific properties are listed and described in
178
\l {Qt Positioning plugins#Default plugins}.
179
180
\sa backendProperty
181
\since Qt 5.14
182
*/
183
bool
QGeoPositionInfoSource::setBackendProperty(
const
QString &name,
const
QVariant &value)
184
{
185
Q_UNUSED(name)
186
Q_UNUSED(value)
187
return
false
;
188
}
189
190
/*!
191
Returns the value of the backend-specific property named \a name, if present.
192
Otherwise, the returned value will be invalid.
193
Supported backend-specific properties are listed and described in
194
\l {Qt Positioning plugins#Default plugins}.
195
196
\sa setBackendProperty
197
\since Qt 5.14
198
*/
199
QVariant QGeoPositionInfoSource::backendProperty(
const
QString &name)
const
200
{
201
Q_UNUSED(name)
202
return
QVariant();
203
}
204
205
/*!
206
\property QGeoPositionInfoSource::updateInterval
207
\brief This property holds the requested interval in milliseconds between each update.
208
209
If the update interval is not set (or is set to 0) the
210
source will provide updates as often as necessary.
211
212
If the update interval is set, the source will provide updates at an
213
interval as close to the requested interval as possible. If the requested
214
interval is less than the minimumUpdateInterval(),
215
the minimum interval is used instead.
216
217
Changes to the update interval will happen as soon as is practical, however the
218
time the change takes may vary between implementations. Whether or not the elapsed
219
time from the previous interval is counted as part of the new interval is also
220
implementation dependent.
221
222
The default value for this property is 0.
223
224
\note Subclass implementations must call the base implementation of
225
\c {setUpdateInterval()} so that \c {updateInterval()} returns the correct
226
value.
227
228
\note This property can't be used to tune update frequency on iOS and macOS,
229
because their APIs do not provide such possibility. On these systems this
230
parameter is only used to set \l UpdateTimeoutError and trigger an
231
\l errorOccurred signal if the update is not received within the desired
232
interval.
233
*/
234
void
QGeoPositionInfoSource::setUpdateInterval(
int
msec)
235
{
236
Q_D(QGeoPositionInfoSource);
237
d->interval = msec;
238
}
239
240
int
QGeoPositionInfoSource::updateInterval()
const
241
{
242
Q_D(
const
QGeoPositionInfoSource);
243
return
d->interval.value();
244
}
245
246
QBindable<
int
> QGeoPositionInfoSource::bindableUpdateInterval()
247
{
248
Q_D(QGeoPositionInfoSource);
249
return
QBindable<
int
>(&d->interval);
250
}
251
252
/*!
253
\property QGeoPositionInfoSource::preferredPositioningMethods
254
255
\brief Sets the preferred positioning methods for this source.
256
257
If new methods include a method that is not supported by the source, the
258
unsupported method will be ignored.
259
260
If new methods do not include a single method available/supported by the
261
source, the preferred methods will be set to the set of methods which the
262
source has available. If the source has no method availabe (e.g. because its
263
Location service is turned off or it does not offer a Location service),
264
the passed methods are accepted as they are.
265
266
The default value for this property is \l {QGeoPositionInfoSource::}
267
{NoPositioningMethods}.
268
269
\note Subclass implementations must call the base implementation of
270
\c {setPreferredPositioningMethods()} to ensure
271
\c {preferredPositioningMethods()} returns the correct value.
272
273
\sa supportedPositioningMethods()
274
*/
275
void
QGeoPositionInfoSource::setPreferredPositioningMethods(PositioningMethods methods)
276
{
277
Q_D(QGeoPositionInfoSource);
278
d->methods.removeBindingUnlessInWrapper();
279
// The supported positioning methods can change during the calls to this
280
// method, so we can't have a simple check like:
281
// if (currentMethods == methods) return;
282
// Instead we need to save the current value and compare it afterwards
283
const
auto
prevMethods = d->methods.valueBypassingBindings();
284
285
if
(supportedPositioningMethods() != QGeoPositionInfoSource::NoPositioningMethods) {
286
d->methods.setValueBypassingBindings(methods & supportedPositioningMethods());
287
if
(d->methods.valueBypassingBindings() == 0) {
288
d->methods.setValueBypassingBindings(supportedPositioningMethods());
289
}
290
}
else
{
// avoid that turned of Location service blocks any changes to d->methods
291
d->methods.setValueBypassingBindings(methods);
292
}
293
if
(prevMethods != d->methods.valueBypassingBindings())
294
d->methods.notify();
295
}
296
297
QGeoPositionInfoSource::PositioningMethods QGeoPositionInfoSource::preferredPositioningMethods()
const
298
{
299
Q_D(
const
QGeoPositionInfoSource);
300
return
d->methods.value();
301
}
302
303
QBindable<QGeoPositionInfoSource::PositioningMethods>
304
QGeoPositionInfoSource::bindablePreferredPositioningMethods()
305
{
306
Q_D(QGeoPositionInfoSource);
307
return
QBindable<PositioningMethods>(&d->methods);
308
}
309
310
/*!
311
\property QGeoPositionInfoSource::preferredAltitudeType
312
\brief This property holds the preferred reference surface for the
313
altitude of the reported positions.
314
\since 6.13
315
316
Some positioning sources can provide the altitude measured from different
317
reference surfaces: from the mean sea level (MSL) or from the WGS84
318
reference ellipsoid. This property allows to select the preferred one.
319
320
The default value for this property is
321
\l {QGeoCoordinate::AltitudeType}{AltitudeType::Unknown}, which means
322
that no preference is specified. In this case the source reports the
323
altitude in the same way as in the previous Qt versions, and the
324
\l {QGeoCoordinate::}{altitudeType()} of the reported coordinates is
325
\l {QGeoCoordinate::AltitudeType}{AltitudeType::Unknown}. This keeps
326
the reported coordinates comparable with the coordinates that were
327
obtained using the previous Qt versions.
328
329
If the property is set to \l {QGeoCoordinate::AltitudeType}{AltitudeType::MSL}
330
or \l {QGeoCoordinate::AltitudeType}{AltitudeType::WGS84}, the source tries
331
to report the altitude measured from the selected reference surface. If
332
that is not possible, the source reports the altitude that it can provide.
333
In both cases, the \l {QGeoCoordinate::}{altitudeType()} of the reported
334
coordinates specifies the reference surface of the actually reported
335
altitude, or is \l {QGeoCoordinate::AltitudeType}{AltitudeType::Unknown}
336
if the source does not provide such information.
337
338
The sources that do not support this property ignore it, and always
339
report the altitude type as
340
\l {QGeoCoordinate::AltitudeType}{AltitudeType::Unknown}.
341
342
\sa QGeoCoordinate::altitudeType, QGeoCoordinate::AltitudeType
343
*/
344
void
QGeoPositionInfoSource::setPreferredAltitudeType(QGeoCoordinate::AltitudeType type)
345
{
346
Q_D(QGeoPositionInfoSource);
347
if
(d->altitudeType != type) {
348
d->altitudeType = type;
349
Q_EMIT preferredAltitudeTypeChanged(d->altitudeType);
350
}
351
}
352
353
QGeoCoordinate::AltitudeType QGeoPositionInfoSource::preferredAltitudeType()
const
354
{
355
Q_D(
const
QGeoPositionInfoSource);
356
return
d->altitudeType;
357
}
358
359
/*!
360
\class QGeoPositionInfoSourcePrivate
361
\inmodule QtPositioning
362
\internal
363
*/
364
QGeoPositionInfoSource *QGeoPositionInfoSourcePrivate::createSourceReal(
const
QCborMap &meta,
const
QVariantMap ¶meters, QObject *parent)
365
{
366
QGeoPositionInfoSource *s =
nullptr
;
367
auto
factory = QGeoPositionInfoSourcePrivate::loadFactory(meta);
368
if
(factory)
369
s = factory->positionInfoSource(parent, parameters);
370
if
(s)
371
s->d_func()->sourceName = meta.value(QStringLiteral(
"Provider"
)).toString();
372
373
return
s;
374
}
375
376
/*!
377
Creates and returns a position source with the given \a parent that
378
reads from the system's default sources of location data, or the plugin
379
with the highest available priority.
380
381
Returns \c nullptr if the system has no default position source, no valid
382
plugins could be found or the user does not have the permission to access
383
the current position.
384
*/
385
QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *parent)
386
{
387
return
createDefaultSource(QVariantMap(), parent);
388
}
389
390
/*!
391
Creates and returns a position source with the given \a parent that
392
reads from the system's default sources of location data, or the plugin
393
with the highest available priority.
394
395
Returns \c nullptr if the system has no default position source, no valid plugins
396
could be found or the user does not have the permission to access the current position.
397
398
This method passes \a parameters to the factory to configure the source.
399
400
\since Qt 5.14
401
*/
402
QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(
const
QVariantMap ¶meters, QObject *parent)
403
{
404
const
QList<QCborMap> plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
405
for
(
const
QCborMap &obj : plugins) {
406
if
(obj.value(QStringLiteral(
"Position"
)).isBool()
407
&& obj.value(QStringLiteral(
"Position"
)).toBool()) {
408
QGeoPositionInfoSource *source = QGeoPositionInfoSourcePrivate::createSourceReal(obj, parameters, parent);
409
if
(source)
410
return
source;
411
}
412
}
413
return
nullptr
;
414
}
415
416
/*!
417
Creates and returns a position source with the given \a parent,
418
by loading the plugin named \a sourceName.
419
420
Returns \c nullptr if the plugin cannot be found.
421
*/
422
QGeoPositionInfoSource *QGeoPositionInfoSource::createSource(
const
QString &sourceName, QObject *parent)
423
{
424
return
createSource(sourceName, QVariantMap(), parent);
425
}
426
427
/*!
428
Creates and returns a position source with the given \a parent,
429
by loading the plugin named \a sourceName.
430
431
Returns \c nullptr if the plugin cannot be found.
432
433
This method passes \a parameters to the factory to configure the source.
434
435
\since Qt 5.14
436
*/
437
QGeoPositionInfoSource *QGeoPositionInfoSource::createSource(
const
QString &sourceName,
const
QVariantMap ¶meters, QObject *parent)
438
{
439
const
QList<QCborMap> candidates = QGeoPositionInfoSourcePrivate::plugins().values(sourceName);
440
for
(
const
QCborMap &obj : candidates) {
441
if
(QGeoPositionInfoSource *source =
442
QGeoPositionInfoSourcePrivate::createSourceReal(obj, parameters, parent)) {
443
return
source;
444
}
445
}
446
return
nullptr
;
447
}
448
449
/*!
450
Returns a list of available source plugins. This includes any default backend
451
plugin for the current platform.
452
*/
453
QStringList QGeoPositionInfoSource::availableSources()
454
{
455
QStringList plugins;
456
const
auto
meta = QGeoPositionInfoSourcePrivate::plugins();
457
for
(
auto
it = meta.cbegin(), end = meta.cend(); it != end; ++it) {
458
if
(it.value().value(QStringLiteral(
"Position"
)).isBool()
459
&& it.value().value(QStringLiteral(
"Position"
)).toBool()) {
460
plugins << it.key();
461
}
462
}
463
464
return
plugins;
465
}
466
467
QGeoPositionInfoSource::QGeoPositionInfoSource(QGeoPositionInfoSourcePrivate &dd, QObject *parent)
468
: QObject(dd, parent)
469
{
470
qRegisterMetaType<QGeoPositionInfo>();
471
Q_D(QGeoPositionInfoSource);
472
d->interval.setValueBypassingBindings(0);
473
d->methods.setValueBypassingBindings(NoPositioningMethods);
474
}
475
476
/*!
477
\fn QGeoPositionInfo QGeoPositionInfoSource::lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const = 0;
478
479
Returns an update containing the last known position, or a null update
480
if none is available.
481
482
If \a fromSatellitePositioningMethodsOnly is true, this returns the last
483
known position received from a satellite positioning method; if none
484
is available, a null update is returned.
485
*/
486
487
/*!
488
\fn virtual PositioningMethods QGeoPositionInfoSource::supportedPositioningMethods() const = 0;
489
490
Returns the positioning methods available to this source. Availability is defined as being usable
491
at the time of calling this function. Therefore user settings like turned off location service or
492
limitations to Satellite-based position providers are reflected by this function. Runtime notifications
493
when the status changes can be obtained via \l supportedPositioningMethodsChanged().
494
495
Not all platforms distinguish the different positioning methods or communicate the current user
496
configuration of the device. The following table provides an overview of the current platform situation:
497
498
\table
499
\header
500
\li Platform
501
\li Brief Description
502
\row
503
\li Android
504
\li Individual provider status and general Location service state are known and communicated
505
when location service is active.
506
\row
507
\li GeoClue
508
\li Hardcoced to always return AllPositioningMethods.
509
\row
510
\li GeoClue2
511
\li Individual providers are not distinguishable but disabled Location services reflected.
512
\row
513
\li iOS
514
\li Hardcoced to always return AllPositioningMethods.
515
\row
516
\li macOS
517
\li Hardcoced to always return AllPositioningMethods.
518
\row
519
\li Windows (UWP)
520
\li Individual providers are not distinguishable but disabled Location services reflected.
521
\endtable
522
523
\sa supportedPositioningMethodsChanged(), setPreferredPositioningMethods()
524
*/
525
526
527
/*!
528
\property QGeoPositionInfoSource::minimumUpdateInterval
529
\brief This property holds the minimum time (in milliseconds) required to retrieve a position update.
530
531
This is the minimum value accepted by setUpdateInterval() and
532
requestUpdate().
533
*/
534
535
536
/*!
537
\fn virtual void QGeoPositionInfoSource::startUpdates() = 0;
538
539
Starts emitting updates at regular intervals as specified by setUpdateInterval().
540
541
If setUpdateInterval() has not been called, the source will emit updates
542
as soon as they become available.
543
544
An errorOccurred() signal with the \l {QGeoPositionInfoSource::}
545
{UpdateTimeoutError} will be emitted if this QGeoPositionInfoSource subclass
546
determines that it will not be able to provide regular updates. This could
547
happen if a satellite fix is lost or if a hardware error is detected.
548
Position updates will recommence if the data becomes available later on.
549
The \l {QGeoPositionInfoSource::}{UpdateTimeoutError} error will not
550
be emitted again until after the periodic updates resume.
551
552
\note Since Qt6 this method always resets the last error to
553
\l {QGeoPositionInfoSource::}{NoError} before starting the updates.
554
555
\note To understand how to use this method from an Android service, see
556
\l {Qt Positioning on Android}.
557
558
On iOS, starting from version 8, Core Location framework requires additional
559
entries in the application's Info.plist with keys NSLocationAlwaysUsageDescription or
560
NSLocationWhenInUseUsageDescription and a string to be displayed in the authorization prompt.
561
The key NSLocationWhenInUseUsageDescription is used when requesting permission
562
to use location services while the app is in the foreground.
563
The key NSLocationAlwaysUsageDescription is used when requesting permission
564
to use location services whenever the app is running (both the foreground and the background).
565
If both entries are defined, NSLocationWhenInUseUsageDescription has a priority in the
566
foreground mode.
567
*/
568
569
/*!
570
\fn virtual void QGeoPositionInfoSource::stopUpdates() = 0;
571
572
Stops emitting updates at regular intervals.
573
*/
574
575
/*!
576
\fn virtual void QGeoPositionInfoSource::requestUpdate(int timeout = 0);
577
578
Attempts to get the current position and emit positionUpdated() with
579
this information. If the current position cannot be found within the given \a timeout
580
(in milliseconds) or if \a timeout is less than the value returned by
581
minimumUpdateInterval(), an errorOccurred() signal with the
582
\l {QGeoPositionInfoSource::}{UpdateTimeoutError} is emitted.
583
584
If the timeout is zero, the timeout defaults to a reasonable timeout
585
period as appropriate for the source.
586
587
This does nothing if another update request is in progress. However
588
it can be called even if startUpdates() has already been called and
589
regular updates are in progress.
590
591
If the source uses multiple positioning methods, it tries to get the
592
current position from the most accurate positioning method within the
593
given timeout.
594
595
\note Since Qt6 this method always resets the last error to
596
\l {QGeoPositionInfoSource::}{NoError} before requesting
597
the position.
598
599
\note To understand how to use this method from an Android service, see
600
\l {Qt Positioning on Android}.
601
*/
602
603
/*!
604
\fn virtual QGeoPositionInfoSource::Error QGeoPositionInfoSource::error() const;
605
606
Returns the type of error that last occurred.
607
608
\note Since Qt6 the last error is always reset when calling startUpdates()
609
or requestUpdate().
610
*/
611
612
/*!
613
\fn void QGeoPositionInfoSource::positionUpdated(const QGeoPositionInfo &update);
614
615
If startUpdates() or requestUpdate() is called, this signal is emitted
616
when an update becomes available.
617
618
The \a update value holds the value of the new update.
619
*/
620
621
/*!
622
\fn void QGeoPositionInfoSource::errorOccurred(QGeoPositionInfoSource::Error positioningError)
623
624
This signal is emitted after an error occurred. The \a positioningError
625
parameter describes the type of error that occurred.
626
*/
627
628
/*!
629
\enum QGeoPositionInfoSource::Error
630
631
The Error enumeration represents the errors which can occur.
632
633
\value AccessError The connection setup to the remote positioning backend failed because the
634
application lacked the required privileges.
635
\value ClosedError The remote positioning backend closed the connection, which happens for example in case
636
the user is switching location services to off. As soon as the location service is re-enabled
637
regular updates will resume.
638
\value NoError No error has occurred.
639
\value UnknownSourceError An unidentified error occurred.
640
\value [since 6.2] UpdateTimeoutError If requestUpdate() was called, this
641
error indicates that the current position could not be retrieved within
642
the specified timeout. If startUpdates() was called, this error
643
indicates that this QGeoPositionInfoSource subclass determined that it
644
will not be able to provide further regular updates. In the latter case
645
the error would not be emitted again until after the regular updates
646
resume.
647
*/
648
649
/*!
650
\fn void QGeoPositionInfoSource::supportedPositioningMethodsChanged()
651
652
This signal is emitted when the supported positioning methods changed. The cause for a change could be
653
a user turning Location services on/off or restricting Location services to certain types (e.g. GPS only).
654
Note that changes to the supported positioning methods cannot be detected on all platforms.
655
\l supportedPositioningMethods() provides an overview of the current platform support.
656
657
\since Qt 5.12
658
*/
659
660
QT_END_NAMESPACE
661
662
#
include
"moc_qgeopositioninfosource.cpp"
pluginComparator
static bool pluginComparator(const QCborMap &p1, const QCborMap &p2)
Definition
qgeopositioninfosource.cpp:105
Q_GLOBAL_STATIC_WITH_ARGS
Q_GLOBAL_STATIC_WITH_ARGS(PermissionStatusHash, g_permissionStatusHash,({ { qMetaTypeId< QCameraPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QMicrophonePermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QBluetoothPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QContactsPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QCalendarPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QLocationPermission >(), Qt::PermissionStatus::Undetermined } }))
qtpositioning
src
positioning
qgeopositioninfosource.cpp
Generated on
for Qt by
1.18.0