23#include <QGeoCoordinate>
25#include "ui/NameFilterProxyModel.h"
160 [[nodiscard]]
bool lessThan(
const QModelIndex& sourceLeft,
const QModelIndex& sourceRight)
const override;
167 [[nodiscard]]
double distance(
const QModelIndex& sourceIndex)
const;
169 QGeoCoordinate m_referenceCoordinate;
172 QGeoCoordinate m_sortReference;
174 QString m_coordinateRoleName {QStringLiteral(
"center")};
177 int m_coordinateRole {-1};
179 double m_resortDistance {1000.0};
QString coordinateRoleName() const
Getter function for the property with the same name.
void referenceCoordinateChanged()
Notification signal for property with the same name.
void setReferenceCoordinate(const QGeoCoordinate &newReferenceCoordinate)
Setter function for the property with the same name.
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override
Re-implemented from QSortFilterProxyModel.
QGeoCoordinate referenceCoordinate
Position that distances are measured from.
void resortDistanceChanged()
Notification signal for property with the same name.
void setSourceModel(QAbstractItemModel *newSourceModel) override
Re-implemented from QAbstractProxyModel.
void coordinateRoleNameChanged()
Notification signal for property with the same name.
QString coordinateRoleName
Name of the source model role holding the row's QGeoCoordinate.
DistanceSortProxyModel(QObject *parent=nullptr)
Standard constructor.
double resortDistance
Movement of the reference coordinate, in metres, that triggers a re-sort.
void setResortDistance(double newResortDistance)
Setter function for the property with the same name.
double resortDistance() const
Getter function for the property with the same name.
void setCoordinateRoleName(const QString &newCoordinateRoleName)
Setter function for the property with the same name.
NameFilterProxyModel(QObject *parent=nullptr)
Standard constructor.