title: Qt Display tooltip after mouse hover on QGraphicsPixmapItem
body: <p>I'm using QGraphicView to show game map that consist QGraphicsPixmapItems. I need to show tooltip on mouse hover at QGraphicsPixmapItem. </p>
  
  <p>For saving QGraphicsPixmapItem position I using MazeItem:</p>
  
  <pre><code>#ifndef MAZEITEM_H
  #define MAZEITEM_H
  
  #include &lt;QPoint&gt;
  #include &lt;QGraphicsItem&gt;
  
  class MazeItem
  {
  private:
      QPoint myPosition;
      QString myToolTip;
  
  public:
      MazeItem();
      QPoint position() const;
      QString toolTip() const;
      void setToolTip(const QString &amp;toolTip);
      void setPosition(const QPoint &amp;position);
      QPoint getPosition();
      QGraphicsPixmapItem * pixmap;
  };
  
  #endif // MAZEITEM_H
  </code></pre>
  
  <p>I have widget class to display game map:</p>
  
  <pre><code>#include &lt;QWidget&gt;
  #include &lt;QtGui&gt;
  #include &lt;QGraphicsView&gt;
  #include &lt;QToolTip&gt;
  #include "mazeitem.h"
  
  class MazeGUI : public QWidget
  {
      Q_OBJECT
  
  private:
      QGraphicsView * graphicsView;
      QGraphicsScene * graphicsScene;
      QString sceneString;
      int imageSize;
      QList&lt;MazeItem&gt; mazeItems;
      void addItem(int x, int y, QPixmap picture);
      bool event(QEvent *event);
      int itemAt(const QPoint &amp;pos);
  
  public:
      explicit MazeGUI(QWidget *parent = 0);
      void setScene(QString sceneString);
  
  signals:
  
  public slots:
      void redraw();
  
  };
  #endif // MAZEGUI_H
  </code></pre>
  
  <p>In constructor I set mouse tracking.</p>
  
  <pre><code>MazeGUI::MazeGUI(QWidget *parent) :
      QWidget(parent)
  {
      setMouseTracking(true);
      ...
  }
  </code></pre>
  
  <p>This is how I add new maze item.</p>
  
  <pre><code>void MazeGUI::addItem(int x, int y, QPixmap picture)
  {
      MazeItem mazeItem;
      mazeItem.setPosition(QPoint(x, y));
      mazeItem.setToolTip("text");
      mazeItem.pixmap = this-&gt;graphicsScene-&gt;addPixmap(picture);
      mazeItem.pixmap-&gt;setPos(y, x);
      mazeItems.append(mazeItem);
  }
  </code></pre>
  
  <p>And this I have from Qt tutorials, </p>
  
  <pre><code>bool MazeGUI::event(QEvent *event)
  {
      if (event-&gt;type() == QEvent::ToolTip) {
  
          // HERE - it never goes here!!      
  
          QHelpEvent *helpEvent = static_cast&lt;QHelpEvent *&gt;(event);
          int index = itemAt(helpEvent-&gt;pos());
          if (index != -1) {
              QToolTip::showText(helpEvent-&gt;globalPos(), mazeItems[index].toolTip());
          } else {
              QToolTip::hideText();
              event-&gt;ignore();
          }
  
          return true;
      }
      return QWidget::event(event);
  }
  
  int MazeGUI::itemAt(const QPoint &amp;pos)
  {
      for (int i=0; i &lt; mazeItems.size(); ++i)
      {
          if (mazeItems[i].getPosition() == pos)
              return i;
      }
      return -1;
  }
  </code></pre>