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
qnmeapositioninfosource.h
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#ifndef QNMEAPOSITIONINFOSOURCE_H
5#define QNMEAPOSITIONINFOSOURCE_H
6
7#include <QtPositioning/QGeoPositionInfoSource>
8
9QT_BEGIN_NAMESPACE
10
11class QIODevice;
12
14class Q_POSITIONING_EXPORT QNmeaPositionInfoSource : public QGeoPositionInfoSource
15{
16 Q_OBJECT
17public:
18 enum UpdateMode {
19 RealTimeMode = 1,
20 SimulationMode
21 };
22
23 explicit QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent = nullptr);
24 ~QNmeaPositionInfoSource();
25
26 void setUserEquivalentRangeError(double uere);
27 double userEquivalentRangeError() const;
28
29 UpdateMode updateMode() const;
30
31 void setDevice(QIODevice *source);
32 QIODevice *device() const;
33
34 void setUpdateInterval(int msec) override;
35
36 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
37 PositioningMethods supportedPositioningMethods() const override;
38 int minimumUpdateInterval() const override;
39 Error error() const override;
40
41
42public Q_SLOTS:
43 void startUpdates() override;
44 void stopUpdates() override;
45 void requestUpdate(int timeout = 0) override;
46
47protected:
48#if QT_DEPRECATED_SINCE(7, 0)
49 QT6_ONLY(virtual)
50 bool parsePosInfoFromNmeaData(const char *data,
51 int size,
52 QGeoPositionInfo *posInfo,
53 bool *hasFix);
54#endif
55 // ### Qt 7: design a return type that gets rid of out-parameters
56 QT7_ONLY(virtual)
57 bool parsePosInfoFromNmeaData(QByteArrayView data,
58 QGeoPositionInfo *posInfo,
59 bool *hasFix);
60
61 void setError(QGeoPositionInfoSource::Error positionError);
62
63private:
64 Q_DISABLE_COPY(QNmeaPositionInfoSource)
65 friend class QNmeaPositionInfoSourcePrivate;
66 QNmeaPositionInfoSourcePrivate *d;
67};
68
69QT_END_NAMESPACE
70
71#endif
void notifyNewUpdate(QGeoPositionInfo *update, bool fixStatus)
bool parsePosInfoFromNmeaData(QByteArrayView data, QGeoPositionInfo *posInfo, bool *hasFix)
QGeoPositionInfoSource::Error m_positionError
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
\inmodule QtPositioning
QNmeaReader(QNmeaPositionInfoSourcePrivate *sourcePrivate)
QNmeaPositionInfoSourcePrivate * m_proxy
virtual void readAvailableData()=0
virtual ~QNmeaReader()
~QNmeaRealTimeReader() override
QNmeaRealTimeReader(QNmeaPositionInfoSourcePrivate *sourcePrivate)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
#define USE_POSITION_NMEA_PIMPL
static bool propagateCoordinate(QGeoPositionInfo &dst, const QGeoPositionInfo &src, bool force=true)
static int processSentence(QGeoPositionInfo &info, QByteArray &m_nextLine, QNmeaPositionInfoSourcePrivate *m_proxy, QQueue< QPendingGeoPositionInfo > &m_pendingUpdates, bool &hasFix)
static bool propagateAttributes(QGeoPositionInfo &dst, const QGeoPositionInfo &src, bool force=true)
static qint64 msecsTo(const QDateTime &from, const QDateTime &to)
static bool propagateDate(QGeoPositionInfo &dst, const QGeoPositionInfo &src)
static bool mergePositions(QGeoPositionInfo &dst, const QGeoPositionInfo &src, QByteArray nmeaSentence)