how to conert QpointF into int
-
hello everyone,
How can I convert QpointF into int x and int y
many thanks -
Try this:
int x = yourPointF.toPoint().x() int y = yourPointF.toPoint().y()
-
This post is deleted!
-
hello everyone,
How can I convert QpointF into int x and int y
many thanks@ShrikantAmbade You can use the accessor methods of the QPointF object to obtain the X and Y coordinates contained within:
qreal & QPointF::rx()
qreal & QPointF::ry()qreal is a typedef of a double (float on ARM-based platforms)
You can then easily convert them to integers. Its up to you how you want to handle any fractional portion
-
Try this:
int x = yourPointF.toPoint().x() int y = yourPointF.toPoint().y()
@Yves-Maurischat Thanks :)
-
@ShrikantAmbade You can use the accessor methods of the QPointF object to obtain the X and Y coordinates contained within:
qreal & QPointF::rx()
qreal & QPointF::ry()qreal is a typedef of a double (float on ARM-based platforms)
You can then easily convert them to integers. Its up to you how you want to handle any fractional portion
@DRoscoe Thanks