Right click contextMenu on QPushButton
问题 For my app I have created a GUI in Qt Designer and converted it into python(2.6) code. On some of the QPushButton (created with the designer) I want to add a right click context menu. The menu options depend on the application status. How to implement such a context menu ? 回答1: Check if an example below would work for you. The key thing is to set context menu policy for your widget to CustomContextMenu and connect to the widget's customContextMenuRequested signal: import sys from PyQt4 import