input method (or input method handler) specifies look and feel for preedit text and it is usually the combination of highlight background color and highlighted text color. see the textedit.png attached that I took a screenshot of examples/richtext/textedit.
When extra format with QTextFormat::FullWidthSelection is set through QTextEdit::setExtraSelections, the background color input method set is ignored. Then the highlighted text colored text is difficult to read. see the codeeditor.png attached.
How to reproduce the issue
1. run the example qtbase/examples/widgets/widgets/codeeditor/
2. turn (Japanese) input method on
3. input something
4. press space to convert it to something else