Priority: P2: Important
Affects Version/s: 6.3.1
Component/s: QPA: Windows
Environment:Device model: Dell Inspiron 5593 (15")
CPU: Intel i7-1065G7
GPU: Intel Iris Plus + NVIDIA GeForce MX230
OS: Windows 11 Home 21H2 (build 22000.856)
Compiler: MSVC 2019 x64
Commits:8cb78647e3 (qt/qtbase/dev) 8cb78647e3 (qt/tqtc-qtbase/dev) 8edb27d7df (qt/qtbase/6.4) 8edb27d7df (qt/tqtc-qtbase/6.4) 8edb27d7df (qt/tqtc-qtbase/6.4.0) 6d3f165c9f (qt/tqtc-qtbase/6.2)
I'm unsure if the issue lies in Qt or in Windows.
- Use the Windows Snipping Tool ([Win]+[Shift]+S) to snip anything on screen. For maximum effect, ensure that the left edge of the snipped area has very different colours to the right edge.
- Build and run the code above.
- Open Microsoft Paint and paste the clipboard contents into Microsoft Paint.
While output.bmp looks OK (like snip-ok.png), the pasted image is corrupted (like snip-corrupted.png).
It's as if a few columns from the right edge were transferred to the left edge; notice also the 3 red, green, and blue pixels at the bottom-left of the image.
- This has been reproduced on a Windows 11 machine, but not Windows 10.
- If the call to QClipboard::image() and QImage::save() are deleted, then Step #3 doesn't produce a corrupted result. (This suggests it's an issue in Qt)
- This issue affects images pasted into Microsoft Paint and Microsoft OneNote, but it does not affect images pasted into Microsoft Word or written by img.save("output.bmp"). (This suggests it's an issue in Windows)
- This issue only affects images captured by the Windows Snipping Tool. It does not affect images copied from Microsoft Paint, and does not affect images put in the clipboard via QClipboard::setImage().