Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.2
-
None
-
- Qt Version: 6.8.2
- OS: [Windows/macOS/Linux]
- High-DPI Scaling: Yes
- Screen Resolution: 4K, 200% scaling
Description
QGraphicsView::mapFromScene() returns a QPolygon, which implicitly rounds coordinates to integers.
This causes visual artifacts where items near the edge of the view may be clipped or disappear, especially on high-DPI displays where a single logical pixel may map to multiple physical pixels.
Steps to reproduce:
1. Create a QGraphicsView and QGraphicsScene.
2. Add an item (e.g., QGraphicsRectItem) at the scene's edge.
3. Scale the view (e.g., view->scale(1.1, 1.1) or view->scale(1/1.1, 1/1.1)).
4. Use mapFromScene() to get the mapped polygon and observe that its bounding rect may shift due to integer rounding.
Expected behavior:
- mapFromScene() should return a QPolygonF instead of QPolygon, preserving fractional values.
- This would prevent unintended clipping issues.