Made anchors list static const

master
Unknown 2017-03-10 09:36:13 +01:00
parent 0cc40ebe1c
commit f340a436d3
1 changed files with 10 additions and 5 deletions

View File

@ -1099,15 +1099,20 @@ void MainWindow::on_figure_geometry_apply_clicked()
void MainWindow::on_button_deleteFigure_clicked() void MainWindow::on_button_deleteFigure_clicked()
{ {
QModelIndexList indexes; QModelIndexList indexes;
while((indexes = ui->figures_list->selectionModel()->selectedIndexes()).size()) { while ((indexes = ui->figures_list->selectionModel()->selectedIndexes()).size()) {
drawMapFigureTable->removeRow(indexes.first().row()); drawMapFigureTable->removeRow(indexes.first().row());
} }
} }
void MainWindow::on_figureSelect_currentIndexChanged(int index) void MainWindow::on_figureSelect_currentIndexChanged(int index)
{ {
QStringList lookup = QStringList()<<"figure" static const QStringList anchors = QStringList() << "figure"
<< "drawmaparrow" << "drawmapcircle" << "drawmapellipse" << "drawmaparrow"
<< "drawmapline" << "drawmappoint" << "drawmaprectangle" << "drawmaptext"; << "drawmapcircle"
ui->figureInformation->scrollToAnchor(lookup.at(index)); << "drawmapellipse"
<< "drawmapline"
<< "drawmappoint"
<< "drawmaprectangle"
<< "drawmaptext";
ui->figureInformation->scrollToAnchor(anchors.at(index));
} }