KPublicTransport
locationquerymodel.cpp
60 if (m_request.types() != Location::Place && loc.type() != Location::Place && (loc.type() & m_request.types()) == 0) {
65 return Location::distance(m_request.latitude(), m_request.longitude(), loc.latitude(), loc.longitude()) > m_request.maximumDistance();
99 auto it = std::lower_bound(m_locations.begin(), m_locations.end(), loc, [this](const auto &lhs, const auto &rhs) {
Common base class for query models, do not use directly.
Definition abstractquerymodel.h:25
Model representing location query results.
Definition locationquerymodel.h:25
KPublicTransport::LocationRequest request
Specify the actual location query.
Definition locationquerymodel.h:28
const std::vector< Location > & locations() const
The current model content.
Definition locationquerymodel.cpp:182
int queryDelay
Delay in milliseconds until the query is actually performed.
Definition locationquerymodel.h:34
bool isValid() const
Returns true if this is a valid request, that is it has enough parameters set to perform a query.
Definition locationrequest.cpp:44
KPublicTransport::Location::Types types
The type of locations you are interested in.
Definition locationrequest.h:52
bool hasCoordinate() const
Returns true if a valid geo coordinate has been set.
Definition locationrequest.cpp:88
int maximumDistance
When searching by coordinate, the expected maximum distance of the results in meters.
Definition locationrequest.h:42
static double distance(double lat1, double lon1, double lat2, double lon2)
Compute the distance between two geo coordinates, in meters.
Definition location.cpp:474
static Location merge(const Location &lhs, const Location &rhs)
Merge two departure instances.
Definition location.cpp:417
static bool isSame(const Location &lhs, const Location &rhs)
Checks if to instances refer to the same location (which does not necessarily mean they are exactly e...
Definition location.cpp:311
void updated()
Emitted whenever new results are available, even before the search has been completed.
Query operations and data types for accessing realtime public transport information from online servi...
Definition attribution.cpp:16
virtual QHash< int, QByteArray > roleNames() const const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
bool isValid() const const
int row() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
DisplayRole
QVariant fromValue(T &&value)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.