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#ifndef QNMEAPOSITIONINFOSOURCE_H
4#define QNMEAPOSITIONINFOSOURCE_H
5
6#include <QtPositioning/QGeoPositionInfoSource>
7
8QT_BEGIN_NAMESPACE
9
10class QIODevice;
11
13class Q_POSITIONING_EXPORT QNmeaPositionInfoSource : public QGeoPositionInfoSource
14{
15 Q_OBJECT
16public:
17 enum UpdateMode {
18 RealTimeMode = 1,
19 SimulationMode
20 };
21
22 explicit QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent = nullptr);
23 ~QNmeaPositionInfoSource();
24
25 void setUserEquivalentRangeError(double uere);
26 double userEquivalentRangeError() const;
27
28 UpdateMode updateMode() const;
29
30 void setDevice(QIODevice *source);
31 QIODevice *device() const;
32
33 void setUpdateInterval(int msec) override;
34
35 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
36 PositioningMethods supportedPositioningMethods() const override;
37 int minimumUpdateInterval() const override;
38 Error error() const override;
39
40
41public Q_SLOTS:
42 void startUpdates() override;
43 void stopUpdates() override;
44 void requestUpdate(int timeout = 0) override;
45
46protected:
47#if QT_DEPRECATED_SINCE(7, 0)
48 QT6_ONLY(virtual)
49 bool parsePosInfoFromNmeaData(const char *data,
50 int size,
51 QGeoPositionInfo *posInfo,
52 bool *hasFix);
53#endif
54 // ### Qt 7: design a return type that gets rid of out-parameters
55 QT7_ONLY(virtual)
56 bool parsePosInfoFromNmeaData(QByteArrayView data,
57 QGeoPositionInfo *posInfo,
58 bool *hasFix);
59
60 void setError(QGeoPositionInfoSource::Error positionError);
61
62private:
63 Q_DISABLE_COPY(QNmeaPositionInfoSource)
64 friend class QNmeaPositionInfoSourcePrivate;
65 QNmeaPositionInfoSourcePrivate *d;
66};
67
68QT_END_NAMESPACE
69
70#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 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)