Hi.

Is it possible to draw single line with gradient?

I've tried something like this:

QLinearGradientg(QPointF(0.0,0.0),QPointF(0.0,1.0));

g.setCoordinateMode(  QGradient::ObjectBoundingMode  );

g.setColorAt(  0.0,  QColor(  50,  50,  60  )  );

g.setColorAt(  0.5,  QColor(  140,  140,  150  )  );

g.setColorAt(  1.0,  QColor(  50,  50,  60  )  );

p->setPen(  QPen(  QBrush(  g  ),  1.0  )  );
p->drawLine(  1,  2,  1,  opt.rect.height()  -  2  );


But this draws line with average color of gradient: QColor( 105, 105, 115 )

--
Best Regards,
Igor Mironchik.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to