Hello,

I'm trying to intercept wheel events in an event filter and it's not working. Here is the filter:

Qt Code:
  1. bool KeyframeArea::eventFilter(QObject *obj, QEvent *event)
  2. {
  3. if (event->type() == QEvent::MouseButtonPress)
  4. {
  5. QMouseEvent *mouseEvent = static_cast<QMouseEvent *> (event);
  6. mousePressEvent(mouseEvent);
  7. return true;
  8. }
  9. else if (event->type() == QEvent::MouseButtonRelease)
  10. {
  11. QMouseEvent *mouseEvent = static_cast<QMouseEvent *> (event);
  12. mouseReleaseEvent(mouseEvent);
  13. return true;
  14. }
  15. else if (event->type() == QEvent::Wheel)
  16. {
  17. QWheelEvent *wheelEvent = static_cast<QWheelEvent *> (event);
  18. wheelEvent(wheelEvent);
  19. return true;
  20. }
  21.  
  22. // Continue standard event processing.
  23. return QObject::eventFilter(obj, event);
  24. }
To copy to clipboard, switch view to plain text mode 

The filter works for button press and release. For the wheelEvent call I get the error message: `wheelEvent' cannot be used as a function. What's wrong with this? QWheelEvent is included and void wheelEvent(QWheelEvent* event) is declared.