Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
4.8.6, 5.3.0 Beta1
-
None
Description
Surely this code:
painter.setBrush(Qt::NoBrush);
painter.drawRect(0, 0, 99, 99);
isn't supposed to fill the rectangle. But it does, when drawing on a QBitmap.
Regression compared to Qt 3.3, present in both Qt 4.8 and Qt 5.3.
Testcase attached. The drawRect hides the lines that were previously drawn, on the right side (drawing on bitmap).
I tried to debug it, and s->brushData.blend is not null because
qpaintengine_raster_p.h's ensureBrush() says brush.style() != Qt::NoBrush && state()->fillFlags, i.e. it ignores the dirty flags when the style is NoBrush.
So the old brush remains (and for a bitmap, the default brush is QBrush(Qt::color0), for no good reason, see QTBUG-5443 / qpainter.cpp:1849 in Qt 4.8. I guess it's too late to change that, though)