How can I handle mouse event without a inheritance, the usecase can be described as follows:
Suppose that I wanna let the QLabel object to handel MouseMoveEvent
MouseMoveEvent
Yes you can do this, but in python2 you can't use print in your lambda, as it's a statement and not a function and does not return a value.
print
Try this:
ql = QLabel() def event_handler(e): print e.x(), e.y() ql.mouseMoveEvent = event_handler