Which part of documentation is not clear to you ?
In order to install event filter on a QLabel you need to call:
Qt Code:
  1. MyClass * filterObject = new MyClass(); // MyClass is a subclass of QObject
  2. ...
  3. QLabel * label = new QLabel();
  4. label->installEventFilter(filterObject);
To copy to clipboard, switch view to plain text mode 
After that you will be able to catch all the events that goes to label object by reimplementing virtual bool eventFilter( QObject * obj, QEvent * ev ) in filterObject class:
Qt Code:
  1. bool MyClass::eventFilter(QObject *obj, QEvent *event)
  2. {
  3. if (obj == label) {
  4. //... test if the event is MousePress and do something with it
  5. } else {
  6. // pass it to the parent class
  7. return QObject::eventFilter(obj, event);
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 
I've almost copied the example from docs.