QPainter graduation(this);
pen.setWidth(2);
pen.setColor(Qt::white);
graduation.setPen(pen);
graduation.setRenderHint(QPainter::HighQualityAntialiasing);
graduation.translate(center.x(), center.y());
double newRadius = (width() - 50) / 2;
//qreal angleStep = 270 / m_stepsize;
for (int i = 0; i <= m_stepsize; i++)
{
graduation.save();
graduation.rotate(i * angleStep + 135);
graduation.drawLine(newRadius - 8, 0, newRadius, 0);
graduation.drawText(newRadius - 30, 0, "100");
graduation.restore();
}
任何人都可以帮助我。我理解旋转功能,这是它发生在数字上的原因,但我无法弄清楚如何修复它。
答案 0 :(得分:1)
您可以手动计算位置并绘制未旋转的文本:
{{1}}