From cb2d67f229fcb1f1e8b1dc71afcf415d08ba2f2a Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 16 Jan 2016 21:47:15 +0300 Subject: [PATCH] [qt][editor] Display copyable coordinates for convenience. --- qt/editor_dialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qt/editor_dialog.cpp b/qt/editor_dialog.cpp index 375915e498..d0b460bdb6 100644 --- a/qt/editor_dialog.cpp +++ b/qt/editor_dialog.cpp @@ -6,6 +6,7 @@ #include "indexer/classificator.hpp" #include "indexer/feature.hpp" +#include "indexer/feature_algo.hpp" #include "indexer/osm_editor.hpp" #include "base/collection_cast.hpp" @@ -34,6 +35,16 @@ EditorDialog::EditorDialog(QWidget * parent, FeatureType const & feature, Framew QVBoxLayout * vLayout = new QVBoxLayout(); + // Zero uneditable row: coordinates. + ms::LatLon const ll = MercatorBounds::ToLatLon(feature::GetCenter(feature)); + QHBoxLayout * coordinatesRow = new QHBoxLayout(); + coordinatesRow->addWidget(new QLabel("Latitude, Longitude:")); + QLabel * coords = new QLabel(QString::fromStdString(strings::to_string_dac(ll.lat, 6) + + "," + strings::to_string_dac(ll.lon, 6))); + coords->setTextInteractionFlags(Qt::TextSelectableByMouse); + coordinatesRow->addWidget(coords); + vLayout->addLayout(coordinatesRow); + // First uneditable row: feature types. string strTypes; feature.ForEachType([&strTypes](uint32_t type)