QPointF to Point2D
-
wrote on 21 Jun 2016, 10:02 last edited by koahnig
hello everyone.
I have the points from a scene which type is QPointF.
i need these points in Point2D.Is there any form to do this conversion?
Thanks a lot.
-
What is Point2D?
-
wrote on 21 Jun 2016, 11:45 last edited by Joel Bodenmann
As @jsulm pointed out there is no
Point2D
type in Qt. I assume that you either want to use QPoint or QVector2D.
QPoint
is the integer precision equivalent toQPointF
. You can useQPointF::toPoint()
to "convert" aQPointF
toQPoint
(you will obviously loose precision).
QVector2D
has constructors that take aQPoint
orQPointF
. -
As @jsulm pointed out there is no
Point2D
type in Qt. I assume that you either want to use QPoint or QVector2D.
QPoint
is the integer precision equivalent toQPointF
. You can useQPointF::toPoint()
to "convert" aQPointF
toQPoint
(you will obviously loose precision).
QVector2D
has constructors that take aQPoint
orQPointF
.He's probably talking about this.
Just transfer the coordinates from one object to the other, I know of no explicit conversion functions.
-
He's probably talking about this.
Just transfer the coordinates from one object to the other, I know of no explicit conversion functions.
wrote on 22 Jun 2016, 08:49 last edited by@kshegunov yes, thanks to everyone!
1/5