Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
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 try QPolygonF::boundingRect().
QPolygonF::boundingRect()