How to tell the mouse button using QApplication::mouseButtons() in a “click” slot?
问题 I have a QMainWindow, and want to handle the "clicked" signal from a smaller widget (such as tableview) inside it. Originally I connect the signal to a slot of this QMainWindow, this is the most common approach. Now I need to tell which mouse button is clicked, and do different things for left and right button, I found that the "clicked" signal don't have the mouse event information. I tried to implement the "mousePressEvent" function,but there are still some problem. if the mouse action is