Hi there,

i'm writing an application that should display a pie chart. So I used QPainter::drawEllipse and because it should look a bit more professional, i used QTransform::rotate (as you can see in the code). And then i get this strange result that you can see in the attachment (well, it was difficult to descripe).

What am i doing wrong?

Platform: Kubuntu 10.10, KDE 4.6; Qt 4.7


attachment.png

Code:
Qt Code:
  1. QColor color(200,50,50);
  2. QPainter *painter = new QPainter(ui->widget_2);
  3. int h = height();
  4. int w = width();
  5. h = qMin(h,w)/2;
  6. w = qMin(h,w)/2;
  7. QTransform trans;
  8. trans.rotate(-30,Qt::XAxis);
  9. painter->setTransform(trans);
  10. painter->setRenderHint(QPainter::Antialiasing,true);
  11. painter->setPen(color);
  12. painter->setBrush(QBrush(color));
  13. painter->drawEllipse(200,200,200,200);
To copy to clipboard, switch view to plain text mode