Using a QPixmap to paint the background of a window could be done by setting the QPixmap to the texture of a QBrush, and then set the QBrush to the QPalette. This is broken in newer versions of Qt 5 if the pixmap is larger than current screen size in a XRANDR multi-monitor setting.
The attachment contain a test case to reproduce this bug.
I have two monitors with the resolution 1920x1200. Side-by-side, they can form a large virtual screen with the size of 3840 x 1200.
In the code I set a 3840 x 1200 QPixmap to a QBrush, and use that QBrush to paint a window whose size is also 3840 x 1200.
The expected result should be like "expected.png", the window background is filled by the 3840x1200 pixmap.
However, the actual result is "actual.png", in which the QPixmap is clipped and only the left part (1920x1200) is used as the texture pattern and it's repeated twice.
This never happened in earlier Qt 4.8 and 5.4 versions. So I guess it's a regression bug. Please help fix this.
This bug breaks the desktop icon manager of the LXQt desktop environment.
Reported in LXQt bug tracker by many users. https://github.com/lxde/lxqt/issues/1027