Hello all.,

I got stuck somewhere in drawing a line with two colors.
Well i want to draw horizontal, vertical, slant lines with two colors one is above the other just like a sandwich.
eg.. "======================================" just like this. above line of different color and lower line of different color. but without any space in between both.

i have tried

Qt Code:
  1. QLinearGradient gradient1;
  2. gradient1.setColorAt(0.0, Qt::darkBlue);
  3. gradient1.setColorAt(0.1, Qt::red);
  4. painter.setPen(QPen(QBrush(gradient1), penWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
To copy to clipboard, switch view to plain text mode 

but nothing works for me. it just draw line of color red ...

Any idea how to make it possible?