Skip to content
Commit eda53c7f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

autotests: Fix testWindowmanagement

Currently, testIcon fails because the actual and the expected pixmaps
have mismatching formats.

The root cause is that images with an alpha channel will loose the alpha
channel if they are converted to QPixmap using QPixmap::fromImage().

The >> stream operator for the QPixmap class will deserialize pixel data
in a temporary QImage and then use QPixmap::fromImage() to get a pixmap
object.

The >> stream operator for the QIcon class will delegate the task of
reading the icon from a QDataStream to QPixmapIconEngine, which uses the
>> stream operator under the hood to deserialize icon data.

In order to fix testIcon, this change constructs a dummy icon from a
pixmap object returned by QPixmap::fromImage().
parent 33301a94
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment