Well so far found out that when I set the bounding rectangle, it does change it to whatever I set it. I create my path Item drawing a path on the scene and then creating the item giving that path. So when I set it a new bounding rectangle I want the same exact path to be redrawn within the new bounding rectangle that I gave it. So far no matter what size of rectangle I set it to the item disappears, but I noticed that the outline of the bounding rectangle is there, just that the actual path item is not redrawn in the new bounding rectangle.
I keep the QPainterPath that I give it as a member variable so I am doing this:

Qt Code:
  1. void PathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
  2. {
  3. QBrush brush(QColor(200, 200, 200));
  4. painter->setBrush(brush);
  5. painter->setOpacity(0.4);
  6.  
  7. m_path.setFillRule(Qt::WindingFill);
  8. painter->drawPath(m_path);
  9. }
  10.  
  11. QRectF PathItem::boundingRect() const
  12. {
  13. return m_rect;
  14. }
  15.  
  16. QPainterPath PathItem::shape() const
  17. {
  18. return m_path;
  19. }
  20.  
  21. void PathItem::setPath(const QPainterPath &_path)
  22. {
  23. QGraphicsPathItem::setPath(_path);
  24. m_path = _path;
  25. m_rect = path().boundingRect();
  26. }
  27.  
  28. void PathItem::setBoundingRect(QRectF rect)
  29. {
  30. prepareGeometryChange();
  31. m_rect = rect;
  32. update(m_rect);
  33. }
To copy to clipboard, switch view to plain text mode 

Where am I going wrong?