PDA

View Full Version : Qt colors strangeness



Morea
23rd April 2006, 19:16
When trying do draw lines, all I get is black and white picture.


int i;
QPainter painter(this);
QColor backC(255,255,255,0);
QColor greenC(Qt::darkGreen);
QBrush back(backC);
QBrush green(greenC);
painter.fillRect(0,0,300,300,back);
painter.setBrush(green);
for (i=0;i<300;i++)
painter.drawLine(rand()%300, rand()%300, 300,300);

what's wrong with the colors?

Morea
23rd April 2006, 19:20
dang. I should use the pen to draw lines. Sorry to bother you