Unsolved QPolygonF to QRectF
-
I can't convert QPolygonF to QRectF.
I need to return exactly the same object, except it has to be a QRectF created from QPolygonF.Can't find any idea how to even start, since QPolygonF has 4-5 QPoints and QRectF 4 but doubles... Any help?
-
A QRectF can only define a rectangle.
So it is not possible "to return exactly the same object" unless your QPolygonF is a rectangle. -
@Bonnie I wanna convert it only when it is a rectangle, so in this case it will be.
-
@Loc888
Then what's the problem here?
A RectF can be defined by the topLeft point and the bottomRight point of the rectangle.
Or you may tryQPolygonF::boundingRect()
.