timmu
3rd January 2013, 09:43
I'm drawing an image (see below) and it works in principle. However, for some reason two of the commands don't make any difference as if they weren't seen by the compiler. Does anyone have any ideas why?
QPixmap map(100,100);
map.fill(Qt::white);
QPainter p(&map);
QPen pen;
pen.setStyle(Qt::DashDotLine);//doesn't make a difference
pen.setWidth(3); //doesn't make a difference
p.setPen(QColor(0,0,0));
p.drawLine(50,50,100,100);
map.save("file.jpg", 0, 90);
QPixmap map(100,100);
map.fill(Qt::white);
QPainter p(&map);
QPen pen;
pen.setStyle(Qt::DashDotLine);//doesn't make a difference
pen.setWidth(3); //doesn't make a difference
p.setPen(QColor(0,0,0));
p.drawLine(50,50,100,100);
map.save("file.jpg", 0, 90);