Multiple Selection for peer and ban tables

Allows multiple selection and action for the nodes in the peer and ban tables in the Debug Window.
This commit is contained in:
Andrew Chow
2016-10-03 19:40:40 -04:00
parent 4e5782438c
commit addfdebe1a
3 changed files with 53 additions and 44 deletions

View File

@@ -291,17 +291,11 @@ void copyEntryData(QAbstractItemView *view, int column, int role)
}
}
QVariant getEntryData(QAbstractItemView *view, int column, int role)
QList<QModelIndex> getEntryData(QAbstractItemView *view, int column)
{
if(!view || !view->selectionModel())
return QVariant();
QModelIndexList selection = view->selectionModel()->selectedRows(column);
if(!selection.isEmpty()) {
// Return first item
return (selection.at(0).data(role));
}
return QVariant();
return QList<QModelIndex>();
return view->selectionModel()->selectedRows(column);
}
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir,