开发者

how to set the item selection forcefully in Qt

开发者 https://www.devze.com 2022-12-24 00:04 出处:网络
Can any one tell me how to set the item to be selected forcefully.. I tried this after adding items to list row..

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号