如何在Qt中强制设置项目选择
任何人都可以告诉我如何设置要强制选择的项目..
我在将项目添加到列表行后尝试了此操作..
QModelIndex index = mylistview->currentIndex();
mylistview ->setCurrentIndex(index);
它不起作用..索引我得到索引(-1,-1).. 任何人都可以帮我解决这个问题吗
?谢谢
Can any one tell me how to set the item to be selected forcefully..
I tried this after adding items to list row..
QModelIndex index = mylistview->currentIndex();
mylistview ->setCurrentIndex(index);
its not working.. index I am getting index (-1,-1)..
can any one help me on this
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否检查过您已授权选择?在 Qt 文档中,解释了该项目被选中,除非选择模式为
无选择
。Have you check the you have authorized selection? In the Qt Documentation, it is explain the item is selected unless selection mode is
No Selection
.