title: Qt: resize a QGraphicsItem (boundingRect()) into a QGraphicsScene with the mouse
body: <p>I would like to resize the <code>boundingRect()</code> of my <code>QGraphicsItem</code> using the mouse.</p>
  
  <p>To build this I found this <a href="http://qt-project.org/forums/viewthread/7959" rel="noreferrer">topic</a>.
  So I managed to make it work for the right, the bottomright and the bottom of my <code>boundingRect()</code> following the idea of this the topic.</p>
  
  <p>But since the position of my item is defined with the top left of the <code>boundingRect()</code> it is more complicated to modify the size of my item moving the edges linked to this position.</p>
  
  <p>I tried with the top left but the bottom right is also moving. I would like to have the bottom right fixed to only change the size and not the whole position.</p>
  
  <p>Here is a part of my code:                       </p>
  
  <pre><code>void Myclass::mouseMoveEvent(QGraphicsSceneMouseEvent *event) 
  {
      if(_resizemode) //if bottom selected
      {
          prepareGeometryChange();
          _h = event-&gt;pos().y();
      }
  
      if(_resizemode2) //if bottom right selected
      {
          prepareGeometryChange();
          _h = event-&gt;pos().y();
          _w = event-&gt;pos().x();
  
      }
  
      if(_resizemode3) //if right selected
      {
          prepareGeometryChange();
          _w = event-&gt;pos().x();
      }
  
      if(_resizemode4) //if top left selected HERE IS MY ISSUE
      {
          prepareGeometryChange();
          setPos(pos().x()+ event-&gt;pos().x(), pos().y() + event-&gt;pos().y());
          _h = _h - event-&gt;pos().y();
          _w = _w - event-&gt;pos().x();
  
      }
  
      if(!_resizemode&amp;&amp;!_resizemode2&amp;&amp;!_resizemode3&amp;&amp;!_resizemode4)
      {
      update();
      QGraphicsItem::mouseMoveEvent(event);
      }
  }
  </code></pre>
  
  <p><code>_h</code> and <code>_w</code> or the height and the width implemented here:</p>
  
  <pre><code>QRectF Aabb::boundingRect() const
  {
      return QRectF( 0, 0, _w, _h);
  }
  </code></pre>
  
  <p>Does someone know how to resize a <code>QGraphicsItem</code> selecting with the mouse each corners of the <code>boundingRect()</code> please?</p>