sortByColumn(0, Qt::AscendingOrder);
setContextMenuPolicy(Qt::CustomContextMenu);
+ setSelectionMode(QAbstractItemView::ExtendedSelection);
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(showContextMenu(const QPoint&)));
if(index.data(NetworkModel::ItemTypeRole) != NetworkModel::IrcUserItemType)
return;
+ QModelIndexList indexList = selectedIndexes();
+ // make sure the item we clicked on is first
+ indexList.removeAll(index);
+ indexList.prepend(index);
+
QMenu contextMenu(this);
- Client::mainUi()->actionProvider()->addActions(&contextMenu, index);
+ Client::mainUi()->actionProvider()->addActions(&contextMenu, indexList);
contextMenu.exec(QCursor::pos());
}