Не получается выделить несколько строк.
Делаю так:
C++ (Qt)
void TreeView::mousePressEvent(QMouseEvent *e)
{
if(e->modifiers() & Qt::Controlmodifier)
{
QModelIndex idx = indexAt(e->pos());
QModelIndex topLeft = model()->index(idx.row(), 0, QModelIndex());
QModelIndex bottomRight = model()->index(idx.row(), model()->columnCount() - 1, QModelIndex());
QItemSelection selection(topLeft, bottomRight);
selectionModel()->select(selection, QItemSelectionModel::Select);
}
return QTreeView::mousePressEvent(e);
}
Это связано с тем что tablemodel привязана к treview?
Или в коде проблема?