I tied convert this stylesheet to painter, but I'm failed.
stylesheet
"background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);"
"background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);"
To copy to clipboard, switch view to plain text mode
painter
linearGrad.
setColorAt(0,
QColor("#e7effd"));
linearGrad.
setColorAt(1,
QColor("#cbdaf1"));
painter
->fillRect
(option.
rect,
QBrush(linearGrad
));
QLinearGradient linearGrad(0, 0, 0, 1);
linearGrad.setColorAt(0, QColor("#e7effd"));
linearGrad.setColorAt(1, QColor("#cbdaf1"));
painter->fillRect(option.rect, QBrush(linearGrad));
To copy to clipboard, switch view to plain text mode
What is wrong ?
Bookmarks