tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); //设置为可以选中多个目标
(参数含义:QAbstractItemView.NoSelection--不能选择
QAbstractItemView.SingleSelection--选中单个目标
QAbstractItemView.MultiSelection--选中多个目标
QAbstractItemView.ExtendedSelection/QAbstractItemView.ContiguousSelection 的区别不明显,主要功能是正常情况下是单选,但按下Ctrl或Shift键后,可以多选)