Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.2.0 Alpha
-
None
-
-
77bdce84965662a67162d1272245b168c96875db (qt/qtbase/dev) 43f96f7fba575351c90534ad8d66e9485ca382aa (qt/qtbase/6.2)
Description
Problem phenomenon:
When drawing the selection box, some thin lines remain
Steps to reproduce:
Use Fusion style .
Run the example program interview. Use the mouse to draw a selection box in the blank area and make the selection box flip. Such as the practice of GIF in the attachment.
reason:
The problem is here:
https://github.com/qt/qtbase/blob/dev/src/widgets/styles/qfusionstyle.cpp#L1094
rect.adjusted(1, 1, -2, -2)
makes the rectangle smaller, but when rect.x1-rect.x2 = 0. Then x1 + 1, x2-2 leads to x1> x2. This will make the rectangle flip in advance.
So there is a difference between the updated area and the drawn area.
The rectangle has been drawn at the position of L1090. The drawing of 1094 makes the color darker and adds a one-pixel white border. However, it is difficult to distinguish with the eyes because of transparency, so I think the code of 1094 is redundant.