import sys
from PyQt4.QtGui import QWidget, QApplication


class MyWidget(QWidget):

    def mousePressEvent(self, event):
        print('clicked')
app = QApplication(sys.argv)
widget = MyWidget()
widget.show()
app.exec_()
PyQt, click action on Qwidget