-
Bug
-
Resolution: Done
-
P2: Important
-
5.14.2
-
None
-
bf8b45e33af960c03c7dccf56e90e76eda1f510e (qt/qtdeclarative/dev) 4f5648478e8f4dd52cfba480980f1a000ff3b3fd (qt/qtdeclarative/5.15)
When the alpha component of selectionColor is set to 0, the blending seems to be disabled for TextInput. This leads to black selection being shown no matter what color is assigned to selectionColor as long as it's alpha is 0.
The sample application is attached: SelectionBug.tar.gz
On the screenshot below you can see 3 example of wrong behavior (on the left) and 2 examples of right behavior together with 2 workarounds (on the right).
On the right top two instances use red selection color with varying transparency. As you can see, even the value of int(1) is enough to enable blending and get visually satisfactory result.
The third example demonstrates that changing opacity to a value less than 1 also forces blending.
The last example strengthens the theory of disabled blending by the evidence that we in fact have transparent pixels rendered in TextInput because if we redirect them to a ShaderEffect we get proper transparency. ShaderEffectSource used here is attached to the top left TextInput and you can see that they have identically selected text.
You can interact with all TextInputs in the attached sample to change the selections. Changing the text in the bottom-most text box will autoselect all TextInputs.