Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
-
None
Description
When passed as "selection" formats at draw()-time, a `QList<QTextLayout::FormatRange>` might fail to properly apply foreground color for each of those formats, unless a (possibly fully translucent) background is set as well.
Attached, please find a very small testcase reproducing the issue:
- when the testcase is run without arguments (e.g., `./test-layout`), the bug shows: the 2nd `D` letter should be red (like the rest), but shows as black
- when the testcase is run with (any) argument (e.g., `./test-layout 1`), it will also apply a fully-translucent background color to the `QTextLayout::FormatRange` - in that case, Qt manages to apply the foreground properly.
Note: the same does not happen when the `QList<QTextLayout::FormatRange>` is set directly on the layout by calling `QTextLayout::setFormats`: it seems to only occur when passed as "selections".