开发者

Handling keyboard input in QListView

开发者 https://www.devze.com 2023-03-24 15:52 出处:网络
I would like to delete an item from a QListView when the delete key is pressed. I know I can override QListView::keyPressEvent but I need to do the deletion from a different class. Is there any signal

I would like to delete an item from a QListView when the delete key is pressed. I know I can override QListView::keyPressEvent but I need to do the deletion from a different class. Is there any signal I could use to detect开发者_运维知识库 the delete key?


Check QObject::installEventFilter, I think it is exactly what you are looking for and also has a small example for your case.

0

精彩评论

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

关注公众号