Fix broken previews for small selection
Review Request #129135 - Created Oct. 9, 2016 and submitted
The use of QGraphicsDropShadowEffect in KSImageWidget enables opacity.
When the previous format is RGB32, it can be converted directly to
ARGB32 with no data changes (assuming that the pixel data really has the
Apparently the data returned by XCB has varying values (including zero)
for the alpha channel which violates the RGB32 format and results in
fully transparant pictures. Explicitly set the bits to fix this.
Small selection, large selection, tall/lengty, they all seem to give a proper preview now.
Also managed to reproduce this with a small Qt program with varying opacity levels. Disabling the graphics effect makes the problem go away but also removes the nice drop shadow.
Tested with Qt 5.7.0 on Arch Linux with Intel graphics.