ui->setupUi(this);
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableWidget->setMouseTracking(true);
connect(ui->tableWidget,SIGNAL(cellEntered(int,int)),this,SLOT(doSomeThing(int,int)));
可以的啊