multi select and removal. Slides aren't perfect yet.

This commit is contained in:
Chris Cochrun 2023-01-24 15:29:56 -06:00
parent 4bf1790708
commit 7a8c7cc389
7 changed files with 77 additions and 3 deletions

View file

@ -372,6 +372,22 @@ void ServiceItemModel::removeItem(int index) {
endRemoveRows();
}
void ServiceItemModel::removeItems() {
for (int i = m_items.length() - 1; i > -1; i--) {
QModelIndex idx = index(i);
ServiceItem *item = m_items[idx.row()];
if (item->selected()) {
qDebug() << "Removing item:" << i;
beginRemoveRows(QModelIndex(), i, i);
m_items.removeAt(i);
endRemoveRows();
emit rowRemoved(i, *item);
qDebug() << "emitted removal of item:" << item->name();
}
}
}
bool ServiceItemModel::moveRows(int sourceIndex, int destIndex, int count) {
qDebug() << sourceIndex;
qDebug() << destIndex;