| 488 | } |
| 489 | |
| 490 | void MacroTableModel::removeMultipleColumns(QModelIndexList l){ |
| 491 | // The list is not always in order, so sort it from lowest to highest |
| 492 | std::sort(l.begin(), l.end(), [](const QModelIndex& a, const QModelIndex& b) { return a < b; }); |
| 493 | // and then iterate counting down |
| 494 | for(int i = l.length(); i--;){ |
| 495 | const int row = l.at(i).row(); |
| 496 | emit beginRemoveRows(QModelIndex(), row, row); |
| 497 | macroLines.remove(row); |
| 498 | emit endRemoveRows(); |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | bool MacroTableModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int dstrow, int column, const QModelIndex& parent){ |
| 503 | if(dstrow == -1 || action != Qt::MoveAction || !data->hasFormat("application/x-qabstractitemmodeldatalist")) |