/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
qt/qt_common/helpers.cpp
42 строки
1 KB
Mikhail Gorbushin
[geometry] Get rid of MercatorBounds, refactor to namespace mercator
01 ноя 2019, 11:09
01 ноя 2019, 11:09
6f5d401
Код
Авторство
О чём код?
#include "qt/qt_common/helpers.hpp" #include "geometry/mercator.hpp" #include <QtCore/QDateTime> namespace qt { namespace common { bool IsLeftButton(Qt::MouseButtons buttons) { return buttons & Qt::LeftButton; } bool IsLeftButton(QMouseEvent const * const e) { return IsLeftButton(e->button()) || IsLeftButton(e->buttons()); } bool IsRightButton(Qt::MouseButtons buttons) { return buttons & Qt::RightButton; } bool IsRightButton(QMouseEvent const * const e) { return IsRightButton(e->button()) || IsRightButton(e->buttons()); } bool IsCommandModifier(QMouseEvent const * const e) { return e->modifiers() & Qt::ControlModifier; } 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 = mercator::YToLat(point.y); info.m_longitude = mercator::XToLon(point.x); info.m_horizontalAccuracy = 10; info.m_timestamp = QDateTime::currentMSecsSinceEpoch() / 1000.0; return info; } } // namespace common } // namespace qt