diff --git a/client/portstatsfilterdialog.cpp b/client/portstatsfilterdialog.cpp index baf9192..55882f1 100644 --- a/client/portstatsfilterdialog.cpp +++ b/client/portstatsfilterdialog.cpp @@ -86,12 +86,13 @@ void PortStatsFilterDialog::on_tbSelectIn_clicked() rows.append(idx.row()); qSort(rows.begin(), rows.end(), qGreater()); - int count = mSelected.rowCount(); + QModelIndex idx = lvSelected->selectionModel()->currentIndex(); + int insertAt = idx.isValid() ? idx.row() : mSelected.rowCount(); foreach(int row, rows) { QList items = mUnselected.takeRow(row); - mSelected.insertRow(count, items); + mSelected.insertRow(insertAt, items); } } @@ -115,7 +116,10 @@ void PortStatsFilterDialog::on_tbSelectOut_clicked() void PortStatsFilterDialog::on_lvUnselected_doubleClicked(const QModelIndex &index) { QList items = mUnselected.takeRow(index.row()); - mSelected.appendRow(items); + QModelIndex idx = lvSelected->selectionModel()->currentIndex(); + int insertAt = idx.isValid() ? idx.row() : mSelected.rowCount(); + + mSelected.insertRow(insertAt, items); } void PortStatsFilterDialog::on_lvSelected_doubleClicked(const QModelIndex &index)