Priority: P1: Critical
Affects Version/s: 5.1.1, 5.15.0
Fix Version/s: 5.15.1
Commits:de3b2541de380c04008cce7937076e10496cb78b (qt/qtbase/dev) 5d9e7e7305fc0cbed8f7be80fb996f3ac653ff75 (qt/qtbase/5.15)
pen->setStyle( Qt::DashLine );
inside a QGLWidget's paint function can cause sudden pen color changes when drawing other things such as rects or QPainterPath's and simple lines. The pen color seems to change to colors of other objects that are drawn, but only sometimes.
As soon as drawing only solid lines, no problems. Also the software renderer handles things fine and doesn't show this problem.
Even in the next frames, items that are painted BEFORE the actual setStyle call will get a wrong color, even while we directly do a setPen and setBrush before painting. It is internally overwritten by Qt somehow.
I know this might be vague, but the setStyle function, and probably setDashOffset do something that might overwrite memory somewhere or so. It is only at some times that the color changes, depending on what else is drawn on the screen.
The problem is this happens in quite a big codebase. I am not sure if it is easy to reproduce in a small example, but it is certainly a Qt bug.
Everything renders fine, until I start drawing some lines with the dashed pattern. Other non-solid styles also show the same issue. Only solid style's prevent this bug from happening.