PDA

View Full Version : QGradiant::StretchToDeviceMode



Qiieha
24th November 2011, 13:58
Hi

I use the QGradient to color a QTableWidgetItem in a special way. On Linux the QTableWidgetItem looks like I want, but under Windows the effects aren't shown, because
the linear gradient doesn't scale. If I extend the column the effect are visible, but they have to visible everytime...



QLinearGradient gradient(0,0,1,0);
gradient.setSpread(QGradient::PadSpread);
gradient.setCoordinateMode(QGradient::StretchToDev iceMode);
QGradientStops qStops;
QGradientStop qStop1(0.180095,color);//0.464929
QGradientStop qStop2(0.49763,QColor(255,255,255,255));//0.8540281

qStops.append(qStop1);
qStops.append(qStop2);
gradient.setStops(qStops);
return gradient;

//....

QBrush color(gradient);
item.setBackground(color);


What can I do?

thank u

Qiieha
25th November 2011, 11:14
Does nobody know a solution?

Qiieha
28th November 2011, 09:32
Hi I send you an example. Maybe somebody can try it on Linux and on Windows. Just compile and see...

Qiieha
29th November 2011, 10:01
Nobody can help ?:(

Qiieha
7th December 2011, 09:10
It seems to be a Windows-Bug.