class Main(QWidget):

    def __init__(self, parent=None):
        super(Main, self).__init__(parent)
layout = QHBoxLayout(self)
layout.addWidget(QLabel('this is the main frame'))

def mousePressEvent(self, QMouseEvent):
    print(QMouseEvent.pos())
a = QApplication([])
m = Main()
m.show()
sys.exit(a.exec_())
How to detect any mouse click on PySide Gui?