tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); //设置为可以选中多个目标
(参数含义:QAbstractItemView.NoSelection--不能选择
QAbstractItemView.SingleSelection--选中单个目标
QAbstractItemView.MultiSelection--选中多个目标
QAbstractItemView.ExtendedSelection/QAbstractItemView.ContiguousSelection 的区别不明显,主要功能是正常情况下是单选,但按下Ctrl或Shift键后,可以多选)
QT控制tableWidget单选或多选
猜你喜欢
转载自blog.csdn.net/yyj108317/article/details/102660516
今日推荐
周排行