Okay I found the place in the Qt Windows specific code that sets the forground and background of the QInputMethodEvents:
It is here:
qtbase/src/plugins/platforms/windows
/qwindowsinputcontext.cpp
The code in question is this routine:
Code:
enum StandardFormat {
PreeditFormat,
SelectionFormat
};
static inline QTextFormat standardFormat(StandardFormat format)
{
QTextCharFormat result;
switch (format) {
case PreeditFormat:
result.setUnderlineStyle(QTextCharFormat::DashUnderline);
break;
case SelectionFormat: {
// TODO: Should be that of the widget?
const QPalette palette = QGuiApplication::palette();
const QColor background = palette.text().color();
result.setBackground(QBrush(background));
result.setForeground(palette.window());
break;
}
}
return result;
}
But it makes no sense as it inverts the foreground and background colors and even adds an underline style.
What bothers me most is the ToDo comment ...