Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.2, 5.7.1, 5.8.0, 5.9.1
-
None
-
x86/x64 machine (with qreal == double) for the test program
Description
QRectF::operator==() uses qFuzzyCompare(), while QPointF::operator==() uses qFuzzyIsNull(), but the two methods yield different comparison results for sufficiently high floating point values (but as low as 200.0, see attached test program)
This creates interesting situations where
rect1 == rect2 && rect1.topLeft() != rect2.topLeft()
See attached test program, which shows exactly where things start breaking (at least on a machine with sizeof(qreal)==sizeof(double)).
I would have provided a change request with a fix to switch QPointF::operator==() to use qFuzzyCompare, but I'm not 100% sure this is the right fix. Maybe qFuzzyIsNull() itself needs to be fixed instead, or something else. So I'm opening this issue first for feedback on the preferred fix, then I'll be happy to provide a change request with the fix if needed.
Attachments
Issue Links
- resulted in
-
QTBUG-60359 QPainter::drawPath fails to draw a QPainterPath that contains a tiny ellipse
- Closed