title: How do you change the position of the boundingRect() of a QGraphicsItem on a QGraphicsScene?
body: <p>I have set the <code>boundingRect()</code> of my <code>QGraphicsItem</code> to a certain coordinate on the scene. How can I change the coordinates based on the <code>QGraphicsItem::mouseMoveEvent</code>?</p>
  
  <hr>
  
  <p>Below is the code I have written. But this code only sets the position of the shape I drew within the <code>boundingRect()</code> to a coordinate inside the <code>boundingRect()</code>. What I want to be able to do is move the entire <code>QGraphicsItem</code> to a set coordinate.</p>
  
  <pre><code>void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
  {
      QGraphicsItem::mouseMoveEvent(event);
  
      if (y()&gt;=394 &amp;&amp; y()&lt;425) //if in the range between 425 and 394 I want it to move to 440.
      {
          setPos(440, y());
      }
      else if ... //Other ranges such as that in the first if statement
      {
          ... //another y coordinate
      }
      else //If the item is not in any of the previous ranges it's y coordinate is set to 0
      {
          setPos(0,y()); //I had expected the item to go to y = 0 on the scene not the boundingRect()
      }
  
  }
  </code></pre>
  
  <p>The scene is 880 by 860 and the <code>boundingRect()</code> is set like this:</p>
  
  <pre><code>QRectF QGraphicsItem::boundingRect() const
  {
      return QRectF(780,425,60,30);
  }
  </code></pre>