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.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论