diff options
author | vng <viktor.govako@gmail.com> | 2012-04-05 17:07:20 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:37:13 +0300 |
commit | 2dd01ba8468ea37435f6f193aa9f9bac38c234ea (patch) | |
tree | 158614efe1c4f7a186ece2a590b318e455451e73 /qt | |
parent | 2da592bcb08f0fe7000876a432143ba29ad6442d (diff) |
[desktop] Get address from point when right button down.
Diffstat (limited to 'qt')
-rw-r--r-- | qt/draw_widget.cpp | 19 |
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); } |