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:
authorAlex Zolotarev <deathbaba@gmail.com>2011-05-16 14:11:03 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:17:21 +0300
commit718503d6310388c5a642e4d6a3078dfcc2a289a3 (patch)
treebe9029437afd61735f1d765b56bd45cc411ec303 /qt
parentcfd16d8c8b9b403c9afd2fc835f5b89ca0f6d607 (diff)
Search by world map
Diffstat (limited to 'qt')
-rw-r--r--qt/mainwindow.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/qt/mainwindow.cpp b/qt/mainwindow.cpp
index 75ecd03320..87c7ad48be 100644
--- a/qt/mainwindow.cpp
+++ b/qt/mainwindow.cpp
@@ -357,12 +357,17 @@ void MainWindow::OnSearchTextChanged(QString const & str)
void MainWindow::OnSearchResult(string const & name, m2::RectD const & rect)
{
QTableWidget * table = static_cast<QTableWidget *>(m_Docks[3]->widget());
- table->insertRow(0);
+
+ int const rowCount = table->rowCount();
+ if (rowCount > 100)
+ return;
+
+ table->setRowCount(rowCount + 1);
QTableWidgetItem * item = new QTableWidgetItem(QString::fromUtf8(name.c_str()));
item->setData(Qt::UserRole, QRectF(QPointF(rect.minX(), rect.maxY()),
QPointF(rect.maxX(), rect.minY())));
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- table->setItem(0, 0, item);
+ table->setItem(rowCount, 0, item);
if (!m_Docks[3]->isVisible())
m_Docks[3]->show();