[Solved] Making a QRect that surrounds other QRects
-
Is there a quick way to create a
QRectthat surrounds other, specified,QRectitems?Context: I have to implement the
boundingRect()method in aQGraphicsItemclass. The class contains two things: AQPainterPathfor a symbol and aQRectfor text that goes next to the symbol. In theboundingRect()method I need to return aQRectthat surrounds the two.Do I need to calculate the position and the size of the rectangle manually or is there some easy magic way of doing this?
-
@Joel-Bodenmann said:
QRectF QRectF::united ( const QRectF & rectangle ) const
-
@Joel-Bodenmann said:
Just do not be confused. You need QRectF not QRect
virtual QRectF boundingRect () const = 0 -
That's exactly what I have been looking for! I definitely searched for the wrong terms.
Thank you for your help. Very appreciated.