diff options
Diffstat (limited to 'ui/qt/models/uat_model.cpp')
-rw-r--r-- | ui/qt/models/uat_model.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/qt/models/uat_model.cpp b/ui/qt/models/uat_model.cpp index 37879ccdbb..c4e7a1fc60 100644 --- a/ui/qt/models/uat_model.cpp +++ b/ui/qt/models/uat_model.cpp @@ -382,6 +382,22 @@ bool UatModel::copyRow(int dst_row, int src_row) return true; } +bool UatModel::moveRow(int src_row, int dst_row) +{ + if (src_row < 0 || src_row >= rowCount() || dst_row < 0 || dst_row >= rowCount()) + return false; + + int dst = src_row < dst_row ? dst_row + 1 : dst_row; + + beginMoveRows(QModelIndex(), src_row, src_row, QModelIndex(), dst); + uat_move_index(uat_, src_row, dst_row); + record_errors.move(src_row, dst_row); + dirty_records.move(src_row, dst_row); + uat_->changed = TRUE; + endMoveRows(); + + return true; +} bool UatModel::hasErrors() const { |