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...
gradient.
setCoordinateMode(QGradient::StretchToDeviceMode);
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;
//....
item.setBackground(color);
QLinearGradient gradient(0,0,1,0);
gradient.setSpread(QGradient::PadSpread);
gradient.setCoordinateMode(QGradient::StretchToDeviceMode);
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);
To copy to clipboard, switch view to plain text mode
What can I do?
thank u
Bookmarks