Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能告诉我如何设置要强制选择的项目..
我在将项目添加到列表行后尝试了这个..
QModelIndex index = mylistview->currentIndex(); mylistview ->setCurrentIndex(index);
它不工作..索引我得到索引(-1,-1)..任何人都可以帮助我
谢谢
你检查过你有授权的选择吗?在Qt 文档中,除非选择模式为 ,否则说明该项目被选中No Selection。
No Selection