-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.15.2, 6.2.3, 6.3.0 Beta2
-
None
-
OS: Windows 10/11 Pro
Platform: Intel i7-1195G7
Qt release: Qt 6.2.3, Qt 6.3.0, Qt 5.15.2
Compiler: MSVC 2019
Issue description
QImage from Qt 6.2.3/6.3.0/5.15.2 cannot load image from embedded resource, but the resource is accessible via QFile API. This is only limited to Windows 10/11 with Intel i7-1195G7 CPU. However, if using a Linux virtual machine on the same machine, the issue doesn't exist.
Example code
Please refer to a [sample project on GitHub|https://github.com/zhongdongy/qt-forum-samples/tree/master/qimage-not-loading].
The same code will print some information to console (ignore the main window). The first output is the resource size given by QFile API. The second output is the null check of QImage loading resource using constructor. The third output is null check of QImage loading resource by QByteArray yield from QFile instance. Here is the output given by Windows 10/11:
// Windows 10/11 (Intel i7-1195G7) output, which is unexpected Bytes length: 277370 Is QImage instance null: true Is QImage2 instance null: true
// Linux (virtual machine) output, which is expected Warning: Ignoring WAYLAND_DISPLAY on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Bytes length: 277370 qt.gui.icc: fromIccProfile: failed minimal tag size sanity Is QImage instance null: false qt.gui.icc: fromIccProfile: failed minimal tag size sanity Is QImage2 instance null: false