wirasto
21st January 2010, 20:57
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);"
painter
QLinearGradient linearGrad(0, 0, 0, 1);
linearGrad.setColorAt(0, QColor("#e7effd"));
linearGrad.setColorAt(1, QColor("#cbdaf1"));
painter->fillRect(option.rect, QBrush(linearGrad));
What is wrong ?
stylesheet
"background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);"
painter
QLinearGradient linearGrad(0, 0, 0, 1);
linearGrad.setColorAt(0, QColor("#e7effd"));
linearGrad.setColorAt(1, QColor("#cbdaf1"));
painter->fillRect(option.rect, QBrush(linearGrad));
What is wrong ?