title: itemAt not returning custom qGraphicsItem
body: <p>I have a custom implementation of qGraphicsScene and a custom qGraphicsItem that I click on, but the itemAt function never returns a value, even though I am fairly certain that I'm clicking on the item.</p>
  
  <pre><code>void VScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
  {
      if ((vMouseClick) &amp;&amp; (event-&gt;pos() == vLastPoint)) {
          QGraphicsItem *mod = itemAt(event-&gt;pos(), QTransform());
          if (mod) { // Never returns true
              // ...
          }
      }
  }
  </code></pre>
  
  <p>For clarity, the module is added in the following code:</p>
  
  <pre><code>void VScene::addModule(QString modName, QPointF dropPos)
  {
      VModule *module = new VModule();
      addItem(module);
      // the QPointF value comes from an event in mainWindow, the coordinate is mapped to my scene.
      module-&gt;setPos(dropPos);
  }
  </code></pre>
  
  <p>... and here is the custom qGraphicsItem that I have written.</p>
  
  <p>VModule.h:</p>
  
  <pre><code>class VModule : public QObject, public QGraphicsItem
  {
      public:
          explicit VModule();
          QRectF boundingRect() const;
          void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
  
      private:
          qreal w;
          qreal h;
          int xAddr;
          int yAddr;
          QPolygonF baseShape;
  }
  </code></pre>
  
  <p>VModule.cpp:</p>
  
  <pre><code>VModule::VModule()
  {
      w = 80;
      h = 80;
      xAddr = w / 2;
      yAddr = h / 2;
  
      // Use the numbers to create a number of polygons
      QVector&lt;QPointF&gt; basePoints = { QPointF(0.0, 0.0),
                                      QPointF(xAddr, yAddr),
                                      QPointF(0.0, yAddr * 2),
                                      QPointF(-xAddr, yAddr) };
      baseShape = QPolygonF(basePoints);
  }
  
  QRectF VModule::boundingRect() const
  {
      return QRectF(-xAddr, 0, w, h);
  }
  
  void VModule::paint(QPainter *painter, const QStypeOptionGraphicsItem *option, QWidget *widget)
  {
      // brushes and so on are set
      // ...
  
      painter-&gt;drawPolygon(baseShape, qt::OddEvenFill);
  
      // there are other polygons are drawn in the same way as above
  }
  </code></pre>
  
  <p>Are there any problems with my implementation? Is there something I am missing? Thanks in advance for any help.</p>