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);

 


   


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM