Morea
23rd April 2006, 18: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?
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?