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
qgeoareamonitor_polling.h
Go to the documentation of this file.
1
// Copyright (C) 2021 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
5
#
ifndef
QGEOAREAMONITORPOLLING_H
6
#
define
QGEOAREAMONITORPOLLING_H
7
8
#
include
<
QtPositioning
/
qgeoareamonitorsource
.
h
>
9
#
include
<
QtPositioning
/
qgeopositioninfosource
.
h
>
10
#
include
<
QtCore
/
qmutex
.
h
>
11
12
/**
13
* QGeoAreaMonitorPolling
14
*
15
*/
16
17
QT_BEGIN_NAMESPACE
18
19
class
QGeoAreaMonitorPollingPrivate
;
20
class
QGeoAreaMonitorPolling
:
public
QGeoAreaMonitorSource
21
{
22
Q_OBJECT
23
public
:
24
explicit
QGeoAreaMonitorPolling
(
QObject
*
parent
= 0);
25
~
QGeoAreaMonitorPolling
();
26
27
void
setPositionInfoSource
(QGeoPositionInfoSource *source)
override
;
28
QGeoPositionInfoSource
*
positionInfoSource
()
const
override
;
29
30
Error
error
()
const
override
;
31
32
bool
startMonitoring
(
const
QGeoAreaMonitorInfo &monitor)
override
;
33
bool
requestUpdate
(
const
QGeoAreaMonitorInfo &monitor,
34
const
char
*signal)
override
;
35
bool
stopMonitoring
(
const
QGeoAreaMonitorInfo &monitor)
override
;
36
37
QList
<
QGeoAreaMonitorInfo
>
activeMonitors
()
const
override
;
38
QList
<
QGeoAreaMonitorInfo
>
activeMonitors
(
const
QGeoShape ®ion)
const
override
;
39
40
QGeoAreaMonitorSource
::
AreaMonitorFeatures
supportedAreaMonitorFeatures
()
const
override
;
41
42
inline
bool
isValid
() {
return
positionInfoSource(); }
43
44
private
Q_SLOTS
:
45
void
positionError
(
QGeoPositionInfoSource
::
Error
error
);
46
void
timeout(
const
QGeoAreaMonitorInfo &monitor);
47
void
processAreaEvent(
const
QGeoAreaMonitorInfo &minfo,
const
QGeoPositionInfo &pinfo,
bool
isEnteredEvent);
48
49
private
:
50
QGeoAreaMonitorPollingPrivate
* d;
51
QGeoAreaMonitorSource::Error lastError =
QGeoAreaMonitorSource
::
NoError
;
52
friend
class
QGeoAreaMonitorPollingPrivate
;
53
54
int
signalConnections = 0;
55
// connectNotify() and disconnectNotify() can be called from a different
56
// thread, so we need to synchronize the access to signalConnections
57
QMutex connectionMutex;
58
59
void
connectNotify
(
const
QMetaMethod &signal)
override
;
60
void
disconnectNotify
(
const
QMetaMethod &signal)
override
;
61
62
int
idForSignal(
const
char
*signal);
63
64
bool
hasConnections()
const
;
65
};
66
67
QT_END_NAMESPACE
68
69
#
endif
// QGEOAREAMONITORPOLLING_H
QGeoAreaMonitorPollingPrivate
Definition
qgeoareamonitor_polling.cpp:44
QGeoAreaMonitorPolling
Definition
qgeoareamonitor_polling.h:21
QGeoAreaMonitorPolling::error
Error error() const override
Returns the type of error that last occurred.
Definition
qgeoareamonitor_polling.cpp:313
QGeoAreaMonitorPolling::positionInfoSource
QGeoPositionInfoSource * positionInfoSource() const override
Returns the current QGeoPositionInfoSource used by this QGeoAreaMonitorSource object.
Definition
qgeoareamonitor_polling.cpp:303
QGeoAreaMonitorPolling::connectNotify
void connectNotify(const QMetaMethod &signal) override
Definition
qgeoareamonitor_polling.cpp:421
QGeoAreaMonitorPolling::supportedAreaMonitorFeatures
QGeoAreaMonitorSource::AreaMonitorFeatures supportedAreaMonitorFeatures() const override
Returns the area monitoring features available to this source.
Definition
qgeoareamonitor_polling.cpp:416
QGeoAreaMonitorPolling::activeMonitors
QList< QGeoAreaMonitorInfo > activeMonitors() const override
Returns the list of all active monitors known to the QGeoAreaMonitorSource object.
Definition
qgeoareamonitor_polling.cpp:396
QGeoAreaMonitorPolling::stopMonitoring
bool stopMonitoring(const QGeoAreaMonitorInfo &monitor) override
Returns true if monitor was successfully removed from the list of \l activeMonitors(); otherwise retu...
Definition
qgeoareamonitor_polling.cpp:389
QGeoAreaMonitorPolling::~QGeoAreaMonitorPolling
~QGeoAreaMonitorPolling()
Definition
qgeoareamonitor_polling.cpp:298
QGeoAreaMonitorPolling::setPositionInfoSource
void setPositionInfoSource(QGeoPositionInfoSource *source) override
Sets the new \l QGeoPositionInfoSource to be used by this QGeoAreaMonitorSource object.
Definition
qgeoareamonitor_polling.cpp:308
QGeoAreaMonitorPolling::requestUpdate
bool requestUpdate(const QGeoAreaMonitorInfo &monitor, const char *signal) override
Enables single shot area monitoring.
Definition
qgeoareamonitor_polling.cpp:357
QGeoAreaMonitorPolling::activeMonitors
QList< QGeoAreaMonitorInfo > activeMonitors(const QGeoShape ®ion) const override
Returns the list of all active monitors known to the QGeoAreaMonitorSource object whose center lies w...
Definition
qgeoareamonitor_polling.cpp:401
QGeoAreaMonitorPolling::startMonitoring
bool startMonitoring(const QGeoAreaMonitorInfo &monitor) override
Returns true if the monitoring of monitor could be successfully started; otherwise returns false.
Definition
qgeoareamonitor_polling.cpp:318
QGeoAreaMonitorPolling::isValid
bool isValid()
Definition
qgeoareamonitor_polling.h:42
QGeoAreaMonitorPolling::disconnectNotify
void disconnectNotify(const QMetaMethod &signal) override
Definition
qgeoareamonitor_polling.cpp:432
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtpositioning
src
plugins
position
positionpoll
qgeoareamonitor_polling.h
Generated on
for Qt by
1.18.0