qt tableview 选择模式

QAbstractItemView::SingleSelection

QAbstractItemView::ContiguousSelection

QAbstractItemView::ExtendedSelection

QAbstractItemView::MultiSelection

QAbstractItemView::NoSelection



单选       只能有一个项目被选中
连续选      只能够被连续选中,例如按下shift后的效果
拓展选      效果和ContiguousSelection一样,同时支持按键支持其他功能,ctrl,shift
多选       效果和按着ctrl一样,当你单击一个项目,再单击另外项目,之前的那条不会被取消选中
无法选中     无法被选中

ui->tableView_showExecuteInfo->setSelectionMode(QAbstractItemView::MultiSelection);

ui->tableView_showExecuteInfo->setSelectionBehavior(QAbstractItemView::SelectRows);

 


   

posted on 2019-02-22 16:15  liujx2019  阅读(2943)  评论(1)    收藏  举报

导航