title: Using Hover Events
body: <p>I am having trouble capturing the hover enter and hover leave events in a <code>QGraphicsRectItem</code>.</p>
  
  <p>I have subclassed this object, and reimplemented the hover enter and hover leave handlers... or at least I think I have. I also set accepts hover event to true in the constructor. </p>
  
  <p>The event is never fired, however. Breakpoints inside the handlers are never hit.</p>
  
  <p>Here is the class:</p>
  
  <pre><code>#include "qhgraphicsrectitem.h"
  
  QhGraphicsRectItem::QhGraphicsRectItem(QGraphicsRectItem *parent) :
      QGraphicsRectItem(parent)
  {
      setAcceptHoverEvents(true);
      setAcceptsHoverEvents(true);
  }
  
  void QhGraphicsRectItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) {
      oldBrush = brush();
      setBrush(QBrush(QColor((oldBrush.color().red() + (0.5 * (255-oldBrush.color().red()))),(oldBrush.color().green() + (0.5 * (255-oldBrush.color().green()))),(oldBrush.color().blue() + (0.5 * (255-oldBrush.color().blue()))))));
  }
  
  void QhGraphicsRectItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
      setBrush(oldBrush);
  }
  </code></pre>
  
  <p>What is it that I am doing wrong?</p>