Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.1
-
None
-
Running this on Linux/X11
Description
When adding in QGraphicsItems like QGraphicsLineItem to a QGraphicsScene, and setting its pen to a pen with setDashPattern results in weird behavior while scrolling the scene.
For example, in a scene containing horizontal QGraphicsLineItem objects, when scrolling horizontally, if the lefthand side of the QGraphicsLineItem is off the edge of the QGraphicsView's viewable area (so, scrolled off the left-hand side of the screen), the dash pattern gets drawn relative to the screen, rather than to the actual geometry of the line. In practice, what happens while scrolling is that the scene scrolls normally while the line is totally onscreen, but once the lefthand side goes past the edge, the line appears to "freeze" in place because the dash doesn't move along with the scroll anymore.
I'm attaching a short little PyQt script which demonstrates this issue.
Note that the script hooks into the scrollbar's valueChanged signal to call QGraphicsView.viewport().update() - without this fix, the bug described at QTBUG-63322 occurs instead, wherein the dashed line doesn't exhibit THIS problem but instead gets all corrupted when the new bits are drawn.