--- a/src/mainWindow.cc Tue Sep 09 01:17:36 2014 +0300 +++ b/src/mainWindow.cc Wed Nov 05 02:07:38 2014 +0200 @@ -560,17 +560,41 @@ void MainWindow::updateSelection() { g_isSelectionLocked = true; - - ui->objectList->clearSelection(); + QItemSelection itemselect; + int top = -1; + int bottom = -1; for (LDObjectPtr obj : Selection()) { if (obj->qObjListEntry == null) continue; - obj->qObjListEntry->setSelected (true); + int row = ui->objectList->row (obj->qObjListEntry); + + if (top == -1) + { + top = bottom = row; + } + else + { + if (row != bottom + 1) + { + itemselect.select (ui->objectList->model()->index (top, 0), + ui->objectList->model()->index (bottom, 0)); + top = -1; + } + + bottom = row; + } } + if (top != -1) + { + itemselect.select (ui->objectList->model()->index (top, 0), + ui->objectList->model()->index (bottom, 0)); + } + + ui->objectList->selectionModel()->select (itemselect, QItemSelectionModel::ClearAndSelect); g_isSelectionLocked = false; }