Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.10.0, 5.10.1, 5.11.0, 5.11.1
-
None
-
openSUSE Tumbleweed 20180712
Android 8.1 (NDK 17.1.4828580, clang, ARM64)
-
12a08ee8eaa27be7dc500b1c15348e8f692949dc
Description
Steps to reproduce:
- Run bug.qml from attached zip using qmlscene
- Shrink the window so that the star has to shrink too
- Enlarge the window to (approximately) it's original size
- Notice that the star has became more translucent than it was originally (screenshot-bad.png)
- Click anywhere inside the window
- Notice that the star has returned to it's original color (screenshot-good.png)
It looks like when IconImage is resized and then returned to it's initial size, it applies the tint color (IconImage::color property) the second time. This has no effect if the tint color is opaque, but if it is translucent, then the whole image becomes more translucent. Only the actual color (i.e. as seen on screen) of the image changes, the value of IconImage::color stays the same.
In some cases the initial actual color of the image is already wrong. You can reproduce that by commenting out the sourceSize line in bug.qml.
The workaround is to change the value of IconImage::color to some other value and then to change it back (this is what clicking the window does). IIRC changing values of IconImage::source or IconImage::name back and forth works too.
I have observed this bug on Linux and on Android (attached example was tested only on Linux). According to comments in my project, the bug is as old as IconImage itself (i.e. since Qt 5.10.0).
That being said, of course IconImage is not a public API. However, this behavior can be seen in several AbstractButton derived public API types (e.g. ItemDelegate and ToolButton). But i have tracked the problem down to IconImage.
Attachments
For Gerrit Dashboard: QTBUG-69506 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
235212,4 | QQuickIconImage: prevent color from being applied twice | 5.11 | qt/qtquickcontrols2 | Status: MERGED | -2 | 0 |