Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qt
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-09-25 17:22:18 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:43:51 +0300
commit41359f557a6634c6dc041113d4bc21e96ced9204 (patch)
tree2bb05e402d1cd43201e59a8f8eb73b88a21e0348 /qt
parentf5b0a6b7567d13de6070b67e73080516ba16dd06 (diff)
Fix types getting in Framework::GetAddressInfo.
Diffstat (limited to 'qt')
-rw-r--r--qt/draw_widget.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp
index 93a6bae616..61878ec8d4 100644
--- a/qt/draw_widget.cpp
+++ b/qt/draw_widget.cpp
@@ -340,34 +340,37 @@ namespace qt
else if (e->button() == Qt::RightButton)
{
// show feature types
- QPoint const & pt = e->pos();
+ QPoint const & qp = e->pos();
+ m2::PointD const pt(qp.x(), qp.y());
QMenu menu;
+ // Get POI under cursor or nearest address by point.
Framework::AddressInfo info;
m2::PointD dummy;
- if (m_framework->GetVisiblePOI(m2::PointD(pt.x(), pt.y()), dummy, info))
+ if (m_framework->GetVisiblePOI(pt, dummy, info))
{
add_string(menu, "POI");
}
else
{
- vector<string> types;
- m_framework->GetFeatureTypes(m2::PointD(pt.x(), pt.y()), types);
-
- for (size_t i = 0; i < types.size(); ++i)
- add_string(menu, types[i]);
-
- m_framework->GetAddressInfo(m_framework->PtoG(m2::PointD(pt.x(), pt.y())), info);
+ m_framework->GetAddressInfo(m_framework->PtoG(pt), info);
}
+ // Get feature types under cursor.
+ vector<string> types;
+ m_framework->GetFeatureTypes(pt, types);
+ for (size_t i = 0; i < types.size(); ++i)
+ add_string(menu, types[i]);
+
(void)menu.addSeparator();
+ // Format address and types.
if (!info.m_name.empty())
add_string(menu, info.m_name);
add_string(menu, info.FormatAddress());
add_string(menu, info.FormatTypes());
- menu.exec(pt);
+ menu.exec(qp);
}
}