Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.11.0
-
None
-
Linux, XCB
Description
When a Text element is used with color: Qt.rgba(r,g,b,0.5) the blending behaviour is not applied correctly. Even if the text element is over a solid background the final texel in the framebuffer in additon to being blended with the RGB of the background ends up with an alpha of 0.5, which is unexpected. This causes a problem when used with a window that has a transparent background.
The following should all look the same. In practice, the top will will appear white when the window is above a white background, the rest are all grey.
Text {
text: "Native with alpha in colour"
font.pixelSize: 20
color: Qt.rgba(0,0,0,0.5)
renderType: Text.NativeRendering
opacity: 1.0
}
Text {
text: "Native with opacity"
font.pixelSize: 20
color: Qt.rgba(0,0,0, 1)
opacity: 0.5
renderType: Text.NativeRendering
}
Text {
text: "Qt with alpha in colour"
font.pixelSize: 20
color: Qt.rgba(0,0,0,0.5)
renderType: Text.QtRendering
opacity: 1.0
}
Text {
text: "Qt with opacity"
font.pixelSize: 20
color: Qt.rgba(0,0,0, 1)
opacity: 0.5
renderType: Text.QtRendering
}
Demo cpp attached