[patch] kstyle issue with gradient brushes

Fred Emmott mail at fredemmott.co.uk
Tue Jul 14 01:48:00 BST 2009


In one of my models, I have the following code:

                case Qt::BackgroundRole:
                                QLinearGradient gradient;
                                gradient.setColorAt(0, Qt::white);
                                gradient.setColorAt(1, Qt::gray);
                                gradient.setStart(0, 0);
                                gradient.setFinalStop(0, 36); // 36 is a 
temporarily hardcoded value, the same as my row heights
                                return static_cast<QBrush>(gradient);

Under Qt styles, such as Plastique (although, works also with phase, windows, 
motif, cleanlook, GTK, CDE) this renders as expected: 


Under styles inheriting from kstyle, such as oxygen, it doesn't:


Patch against 4.2.4 (sorry, my connection's sucking, that's all I've got at 
the moment - appears unresolved in trunk):


For comparison, the relevant QCommonStyle code is:


Additionally, oxygen reimplements hardly any of QStyle::standardIcon - I might 
make a patch if there's interest?

Fred Emmott

More information about the kde-core-devel mailing list