Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > c6df48aa6f24f13ac83670ff4f6d6ea9 > files > 10

qt4-4.3.4-6mdv2008.1.src.rpm

qt-bugs@ issue : 178507
Trolltech task ID : 179170 (status: fixed for Qt 4.4.0)
applied: no
author: Matthew Woehlke <mw_triad@users.sourceforge.net>

This patch fixes incorrect setting of the palette color group in
QItemDelegate that resulted in inactive colors being used for widgets
in active windows.

--- src/gui/itemviews/qitemdelegate.cpp
+++ src/gui/itemviews/qitemdelegate.cpp
@@ -635,10 +635,10 @@

     QPen pen = painter->pen();
     QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
-                              ? QPalette::Normal : QPalette::Disabled;
-    if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
-        cg = QPalette::Inactive;
+                              ? option.palette.currentColorGroup() : QPalette::Disabled;
     if (option.state & QStyle::State_Selected) {
+       if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
+           cg = QPalette::Inactive;
         painter->fillRect(rect, option.palette.brush(cg, QPalette::Highlight));
         painter->setPen(option.palette.color(cg, QPalette::HighlightedText));
     } else {