Can someone point me in the right direction of making a click-able label? I'm working with some code I found on a site, but I'm not converting it right from key event to most events...

Qt Code:
  1. class ClickLabel : public QObject
  2. {
  3. Q_OBJECT
  4.  
  5.  
  6. protected:
  7. bool eventFilter(QObject *obj, QEvent *event);
  8. };
  9.  
  10. bool ClickLabel::eventFilter(QObject *obj, QEvent *event)
  11. {
  12. if (event->type() == QEvent::MouseButtonPress) {
  13. QMouseEvent *MouseEvent = static_cast<QMouseEvent *>(event);
  14. qDebug("MouseClicked", MouseEvent->clicked());
  15. return true;
  16. } else {
  17. // standard event processing
  18. return QObject::eventFilter(obj, event);
  19. }
  20. }
To copy to clipboard, switch view to plain text mode 


errors

error: invalid static_cast from type 'QEvent*' to type 'QMouseEvent*'
error: invalid use of incomplete type 'struct QMouseEvent'
error: forward declaration of 'struct QMouseEvent'