[patch] kstyle issue with gradient brushes

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


Hi,

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: 

http://files.fredemmott.co.uk/kstyle-brush-origin/plastique.png

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

http://files.fredemmott.co.uk/kstyle-brush-origin/oxygen.png

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

http://files.fredemmott.co.uk/kstyle-brush-origin/kstyle.diff

For comparison, the relevant QCommonStyle code is:

http://qt.gitorious.org/qt/qt/blobs/master/src/gui/styles/qcommonstyle.cpp#line787

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

-- 
Fred Emmott
(http://www.fredemmott.co.uk)




More information about the kde-core-devel mailing list