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-04-05 17:07:20 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:37:13 +0300
commit2dd01ba8468ea37435f6f193aa9f9bac38c234ea (patch)
tree158614efe1c4f7a186ece2a590b318e455451e73 /qt
parent2da592bcb08f0fe7000876a432143ba29ad6442d (diff)
[desktop] Get address from point when right button down.
Diffstat (limited to 'qt')
-rw-r--r--qt/draw_widget.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp
index d0a21c6a99..db32f6dbb1 100644
--- a/qt/draw_widget.cpp
+++ b/qt/draw_widget.cpp
@@ -296,6 +296,11 @@ namespace qt
{
return RotateEvent(centerPt.x(), centerPt.y(), pt.x(), pt.y());
}
+
+ void add_string(QMenu & menu, string const & s)
+ {
+ menu.addAction(QString::fromUtf8(s.c_str()));
+ }
}
void DrawWidget::mousePressEvent(QMouseEvent * e)
@@ -325,13 +330,23 @@ namespace qt
{
// show feature types
QPoint const & pt = e->pos();
+ QMenu menu;
+ /*
vector<string> types;
m_framework->GetFeatureTypes(m2::PointD(pt.x(), pt.y()), types);
- QMenu menu;
for (size_t i = 0; i < types.size(); ++i)
- menu.addAction(QString::fromAscii(types[i].c_str()));
+ add_string(menu, types[i]);
+ */
+
+ Framework::AddressInfo info;
+ m_framework->GetAddressInfo(m2::PointD(pt.x(), pt.y()), info);
+
+ add_string(menu, info.m_country);
+ add_string(menu, info.m_city);
+ add_string(menu, info.m_street);
+ add_string(menu, info.m_name);
menu.exec(pt);
}