5#include <QtCore/QByteArrayView>
7#include <QtCore/QRangeModel>
8#include <QtCore/QSortFilterProxyModel>
9#include <QtCore/QString>
10#include <QtCore/qnumeric.h>
11#include <QtPositioning/QGeoCoordinate>
54 static constexpr auto rowCategory = QRangeModel::RowCategory::MultiRoleItem;
79 int count()
const {
return static_cast<int>(_mountpoints.size()); }
91 QList<NTRIPMountpoint> _mountpoints;
104 int count()
const {
return rowCount(); }
110 bool lessThan(
const QModelIndex& left,
const QModelIndex& right)
const override;
bool ntripSourceTableComplete(QByteArrayView body, qsizetype checkedSize=0)
Roles
Roles follow the NTRIPMountpoint property order, as QRangeModel assigns them.
void updateDistances(const QGeoCoordinate &from)
Recompute distances; one dataChanged for DistanceKmRole spans the rows whose distance changed.
void parseSourceTable(const QString &raw, const QGeoCoordinate &from={})
Publish the parsed rows and their distances in a single reset.
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
void updateDistance(const QGeoCoordinate &from)
Recompute distanceKm, or mark it unknown for invalid reference/mountpoint coordinates.
static std::optional< NTRIPMountpoint > fromSourceTableLine(const QString &line)
Parses one source-table line ("STR;..."); none unless it is a valid STR row.
QString mountpoint
The format, navigation systems, country, bitrate and distance that are known, as one line.