[Solved] Making a QRect that surrounds other QRects
Joel Bodenmann last edited by Joel Bodenmann
Is there a quick way to create a
QRectthat surrounds other, specified,
Context: I have to implement the
boundingRect()method in a
QGraphicsItemclass. The class contains two things: A
QPainterPathfor a symbol and a
QRectfor text that goes next to the symbol. In the
boundingRect()method I need to return a
QRectthat 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?
QRectF QRectF::united ( const QRectF & rectangle ) const
Just do not be confused. You need QRectF not QRect
virtual QRectF boundingRect () const = 0
Joel Bodenmann last edited by
That's exactly what I have been looking for! I definitely searched for the wrong terms.
Thank you for your help. Very appreciated.