attempting to add wrapper move function

I believe this won't work, but it's an attempt
This commit is contained in:
Chris Cochrun 2023-09-18 15:44:41 -05:00
parent 42f65b5516
commit b0435e197c
2 changed files with 16 additions and 0 deletions

View file

@ -394,6 +394,21 @@ bool ServiceItemModel::moveUp(int id) {
return false;
}
bool ServiceItemModel::moveRowsRust(int source, int dest, int count, ServiceItemMod *rustModel) {
const QModelIndex parent = index(source).parent();
const bool isMoveDown = dest > source;
if (!beginMoveRows(parent, source, source + count - 1,
parent, dest)) {
qDebug() << "Can't move rows";
return false;
}
const bool moved = rustModel->moveRows(source, dest, count);
endMoveRows();
return moved;
}
QVariantMap ServiceItemModel::getRust(int index, ServiceItemMod *rustModel) const {
QVariantMap item = rustModel->getItem(index);
return item;