I have a UI.py file with the mainWindow class definition (build with Qt Designer and Pyside). The UI is imported in the main module. In the Ui I have a listbox. Based on the left or right mouse clicked on an item a procedure must be executed, e.g leftMouseClicked and rightMouseClicked. Thanks for your help.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
you can define a mousePressEvent() method in your QListWidget subclass to handle mouse press event. Get which button is clicked by the event parameter and save it to an attribute.
Edit: If you use QListView: