After moving an item calculate the bounding rectangle all items occupy by using QRectF::united() on boundingRect()s and resize the scene accordingly.
Of course you may optimise calculations by comparing the original scene size and the element position prior and after a move.
Bookmarks