I have this QPolygonF
selectedPolygon<<
QPointF(1.47 ,
52.21);
selectedPolygon<<
QPointF(1.50 ,
53.12);
selectedPolygon<<
QPointF(1.52 ,
54.48);
selectedPolygon<<
QPointF(1.55,
55.84);
selectedPolygon<<
QPointF(1.57 ,
57.20);
selectedPolygon<<
QPointF(1.60 ,
58.57);
.....................................
selectedPolygon<<
QPointF(1.73 ,
66.28);
selectedPolygon<<
QPointF(1.75 ,
68.10);
selectedPolygon<<
QPointF(1.78 ,
69.92);
selectedPolygon<<
QPointF(1.80,
72.19);
selectedPolygon<<
QPointF(1.83 ,
74.46);
selectedPolygon<< QPointF(1.47 ,52.21);
selectedPolygon<< QPointF(1.50 ,53.12);
selectedPolygon<< QPointF(1.52 ,54.48);
selectedPolygon<< QPointF(1.55,55.84);
selectedPolygon<< QPointF(1.57 ,57.20);
selectedPolygon<< QPointF(1.60 ,58.57);
.....................................
selectedPolygon<< QPointF(1.73 ,66.28);
selectedPolygon<< QPointF(1.75 ,68.10);
selectedPolygon<< QPointF(1.78 ,69.92);
selectedPolygon<< QPointF(1.80,72.19);
selectedPolygon<< QPointF(1.83 ,74.46);
To copy to clipboard, switch view to plain text mode
and in debug mode when I get back these values:
int N = selectedPolygon.size();
for (int i = 0; i < N; i++)
{
x = selectedPolygon.at(i).x();
y = selectedPolygon.at(i).y();
........
}
int N = selectedPolygon.size();
for (int i = 0; i < N; i++)
{
x = selectedPolygon.at(i).x();
y = selectedPolygon.at(i).y();
........
}
To copy to clipboard, switch view to plain text mode
the values comeback as:
(1.47, 52.210000000000001)
(1.5, 53.119999999999997)
(1.52, 54.479999999999997)
(1.55, 55.840000000000003)
(1.5700000000000001, 57.200000000000003)
.........................
(1.47, 52.210000000000001)
(1.5, 53.119999999999997)
(1.52, 54.479999999999997)
(1.55, 55.840000000000003)
(1.5700000000000001, 57.200000000000003)
.........................
To copy to clipboard, switch view to plain text mode
this change causes huge errors to my calculations!!!!!!
why is this happening? is there a way to avoid it??!
Bookmarks