-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
4.6.3
-
None
-
Debian GNU/Linux, mostly squeeze, but with kde3 and it's dependences from lenny.
For many years, I've used a color scheme where text input fields have light-blue background.
However, after upgrading Qt from version 4.4.3 (debian lenny) to 4.6.3 (debian squeeze) qt4 apps started to ignore this setting, and use white background - which is in contrast with the rest of desktop, and hard for my eyes.
I've run several experiments and found that settings from $KDEHOME/share/config/kdeglobals amd from ~/.config/Trolltexh.conf are ignored.
At last I started to trace qt in gdb, and found that Base color role in application palette really gets overwritten by almost-hardcoded values, by the below code from qt_set_x11_resources() from src/gui/kernel/qapplication_x11.cpp:
...
QColor base = Qt::white;
bool bright_mode = false;
if (v >= 255 - 50)
QPalette pal(fg, btn, btn.lighter(125), btn.darker(130), btn.darker(120), wfg.isValid() ? wfg : fg, Qt::white, base, bg);
...
and later this pal is set as default without any hook to change Base color (which can't be anything different from Qt::white or btn.darker(150)) to something different.
Well, there is a point that could be such a hook, it looks like
pal = qt_guiPlatformPlugin()->palette().resolve(pal);
Palette returned by qt_guiPlatformPlugin()->palette() contains my (non-white) Base, as returned by kdePalette() which reads $KDEHOME/share/config/kdeglobals. However, resolve() just overwrites that with resolve()'s argument, so hardcoded white Base goes to default palette and later to all application widgets.
This is a very unpleasant regression. Please fix it, or at least suggest workaround to return better Base color.
Moving code here since it does not display right in the comments section:
#include <QApplication> #include <QLineEdit> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLineEdit *e = new QLineEdit; e->show(); app.exec(); }