[英]QTableView force one cell selection
I want the user to be able to select only one cell at time. 我希望用户一次只能选择一个单元格。 How can I set the maximum possible selection of cells of a QTableView to 1 (c++) ?
如何将QTableView的单元格的最大可能选择设置为1(c ++)?
Set selectionMode
to SingleSelection
and set selectionBehavior
to SelectItems
将
selectionMode
设置为SingleSelection
并将selectionBehavior
设置为SelectItems
tableView->setSelectionMode(QAbstractItemView::SingleSelection);
tableView->setSelectionBehavior(QAbstractItemView::SelectItems);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.