diff options
Diffstat (limited to 'qt/qt_common/helpers.cpp')
-rw-r--r-- | qt/qt_common/helpers.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/qt/qt_common/helpers.cpp b/qt/qt_common/helpers.cpp index a6081809b3..15ba4b68b1 100644 --- a/qt/qt_common/helpers.cpp +++ b/qt/qt_common/helpers.cpp @@ -1,5 +1,9 @@ #include "qt/qt_common/helpers.hpp" +#include "geometry/mercator.hpp" + +#include <QtCore/QDateTime> + namespace qt { namespace common @@ -23,5 +27,16 @@ bool IsCommandModifier(QMouseEvent const * const e) { return e->modifiers() & Qt bool IsShiftModifier(QMouseEvent const * const e) { return e->modifiers() & Qt::ShiftModifier; } bool IsAltModifier(QMouseEvent const * const e) { return e->modifiers() & Qt::AltModifier; } + +location::GpsInfo MakeGpsInfo(m2::PointD const & point) +{ + location::GpsInfo info; + info.m_source = location::EUser; + info.m_latitude = MercatorBounds::YToLat(point.y); + info.m_longitude = MercatorBounds::XToLon(point.x); + info.m_horizontalAccuracy = 10; + info.m_timestamp = QDateTime::currentMSecsSinceEpoch() / 1000.0; + return info; +} } // namespace common } // namespace qt |