4 #ifndef SWIFT_CORE_AFV_MODEL_ATCSTATIONMODEL_H
5 #define SWIFT_CORE_AFV_MODEL_ATCSTATIONMODEL_H
7 #include <QAbstractListModel>
14 namespace swift::core::afv::model
28 const QString &
callsign()
const {
return m_callsign; }
29 QString formattedFrequency()
const;
30 double latitude()
const;
31 double longitude()
const;
32 double radioDistanceM()
const;
33 quint32 frequency()
const;
41 inline bool operator==(
const CSampleAtcStation &lhs,
const CSampleAtcStation &rhs)
43 return lhs.callsign() == rhs.callsign() && qFuzzyCompare(lhs.latitude(), rhs.latitude()) &&
44 qFuzzyCompare(lhs.longitude(), rhs.longitude());
56 CallsignRole = Qt::UserRole + 1,
74 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
77 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
85 void removeStationAtPosition(
int i);
87 QList<CSampleAtcStation> m_atcStations;
const QString & callsign() const
Getter.
CSampleAtcStation()=default
Ctor.
AtcStationRoles
Roles for model.
void updateAtcStations(const QVector< CSampleAtcStation > &atcStations)
Update the stations.
QHash< int, QByteArray > roleNames() const
copydoc QAbstractListModel::roleNames
~CSampleAtcStationModel()
Dtor.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
copydoc QAbstractListModel::data
CSampleAtcStationModel(QObject *parent=nullptr)
Ctor.
int rowCount(const QModelIndex &parent=QModelIndex()) const
copydoc QAbstractListModel::rowCount
#define SWIFT_CORE_EXPORT
Export a class or function from the library.