Do you mean selectionChanged signal? I made a customised slot to be invoked by the selectionChanged signal.
Yes, I have set the selection mode of the QTableView as QAbstractItemView::ExtendedSelection.
Added after 6 minutes:
For the connection:
connect(entityTableView->selectionModel(),SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this,
SLOT(selectionChangedSlot(const QItemSelection &, const QItemSelection &)));
To copy to clipboard, switch view to plain text mode
For the slot:
{
int selectedItems = 0;
QModelIndexList items = selected.indexes();
selectedItems = selected.indexes().size();
...
}
void Scope::selectionChangedSlot(const QItemSelection &selected, const QItemSelection &deselected)
{
int selectedItems = 0;
QModelIndexList items = selected.indexes();
selectedItems = selected.indexes().size();
...
}
To copy to clipboard, switch view to plain text mode
Everytime, the selectedItems is equal to 1 not the number that I have selected.
Bookmarks