1.获得选中行的QModelIndex
connect(tableview->selectionModel(), QItemSelectionModel::currentRowChanged, this, [=](const QModelIndex ¤t,const QModelIndex &previous){
emit Siganl(current);
}
2.根据QModelIndex获得所在单元格的位置
connect(this, & ::Signal, this, [=](QModelIndex cur){
QRect rect = tableview->visualRect(index);
qDebug()<<rect.x()<<rect.y();
}
)
05-10
588

01-25
1960
