View Single Post
Old 10-28-2024, 02:25 PM   #49
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,902
Karma: 6120478
Join Date: Nov 2009
Device: many
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 ...
KevinH is online now   Reply With Quote