PyQt5: QPushButton double click?
问题 I can't find a good answer for this: is there a way for double click to execute a certain function, and single click one other function?? For example: def func1(self): print('First function') def func2(self): print('Second function') self.ui.button.clicked.connect(self.func1) self.ui.button.doubleClicked.connect(self.func2) I've seen double clicking is possible for the QTreeview but not a QPushButton . Thanks! 回答1: You can add the functionality easily yourself by extending QPushButton class: