Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to get the new rect that unite 2 rects which are not intersected?
how to get the new rect that unite 2 rects which are not intersected?
i found the API united, but it seems not satisfy this situation/?
i'm not sure if i understood you correctly, but the result you want would be a rect anymore?
You should look into QRegion in this case
yes, still rect.
i can't use QRegion here, cause it's used in the overriden func boundingRect()
the new rect should just include the 2 rects, i can compare the 4 edges of the 2 rects, but i just want to know whether there is an API already
i still don't know what you exactly want.
Why isn't QRect::united() sufficent for you?
if the 2 rect are not intersected at all...
the result of QRect::united() seems not right...
and why do you think that?
It doesn't matter if the 2 rects are actually intersected or not the result is the same -> the outtermost bounding rect of them
ok i will try...