Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QGEOAREAMONITORPOLLING_H
5#define QGEOAREAMONITORPOLLING_H
6
7#include <QtPositioning/qgeoareamonitorsource.h>
8#include <QtPositioning/qgeopositioninfosource.h>
9#include <QtCore/qmutex.h>
10
18{
20public :
23
26
27 Error error() const override;
28
29 bool startMonitoring(const QGeoAreaMonitorInfo &monitor) override;
30 bool requestUpdate(const QGeoAreaMonitorInfo &monitor,
31 const char *signal) override;
32 bool stopMonitoring(const QGeoAreaMonitorInfo &monitor) override;
33
34 QList<QGeoAreaMonitorInfo> activeMonitors() const override;
35 QList<QGeoAreaMonitorInfo> activeMonitors(const QGeoShape &region) const override;
36
37 QGeoAreaMonitorSource::AreaMonitorFeatures supportedAreaMonitorFeatures() const override;
38
39 inline bool isValid() { return positionInfoSource(); }
40
41private Q_SLOTS:
42 void positionError(QGeoPositionInfoSource::Error error);
43 void timeout(const QGeoAreaMonitorInfo &monitor);
44 void processAreaEvent(const QGeoAreaMonitorInfo &minfo, const QGeoPositionInfo &pinfo, bool isEnteredEvent);
45
46private:
50
51 int signalConnections = 0;
52 // connectNotify() and disconnectNotify() can be called from a different
53 // thread, so we need to synchronize the access to signalConnections
54 QMutex connectionMutex;
55
56 void connectNotify(const QMetaMethod &signal) override;
57 void disconnectNotify(const QMetaMethod &signal) override;
58
59 int idForSignal(const char *signal);
60
61 bool hasConnections() const;
62};
63
64#endif // QGEOAREAMONITORPOLLING_H
\inmodule QtPositioning
Error error() const override
Returns the type of error that last occurred.
QGeoPositionInfoSource * positionInfoSource() const override
Returns the current QGeoPositionInfoSource used by this QGeoAreaMonitorSource object.
void connectNotify(const QMetaMethod &signal) override
QGeoAreaMonitorSource::AreaMonitorFeatures supportedAreaMonitorFeatures() const override
Returns the area monitoring features available to this source.
QList< QGeoAreaMonitorInfo > activeMonitors() const override
Returns the list of all active monitors known to the QGeoAreaMonitorSource object.
bool stopMonitoring(const QGeoAreaMonitorInfo &monitor) override
Returns true if monitor was successfully removed from the list of \l activeMonitors(); otherwise retu...
QGeoAreaMonitorPolling(QObject *parent=0)
void setPositionInfoSource(QGeoPositionInfoSource *source) override
Sets the new \l QGeoPositionInfoSource to be used by this QGeoAreaMonitorSource object.
bool requestUpdate(const QGeoAreaMonitorInfo &monitor, const char *signal) override
Enables single shot area monitoring.
bool startMonitoring(const QGeoAreaMonitorInfo &monitor) override
Returns true if the monitoring of monitor could be successfully started; otherwise returns false.
void disconnectNotify(const QMetaMethod &signal) override
\inmodule QtPositioning
Error
Defines the types of positioning methods.
\inmodule QtPositioning
Error
The Error enumeration represents the errors which can occur.
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeoshape.h:17
\inmodule QtCore
Definition qmetaobject.h:19
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
auto signal
GLbitfield GLuint64 timeout
[4]
GLsizei GLsizei GLchar * source
#define Q_OBJECT
#define Q_SLOTS