Home > Back-end >  Define how QGraphicsItem accurately drawn arc
Define how QGraphicsItem accurately drawn arc

Time:09-18


Qt by drawArc () function to realize circular arc, there are three prototypes, including a rectangle was surrounded by a circular arc of the box, startAngle is the starting point of view, is spanAngle rotation Angle,
DrawArc void drawArc (const QRectF & amp; A rectangle, int startAngle, int spanAngle)
Void drawArc (const QRect & amp; A rectangle, int startAngle, int spanAngle)
Void drawArc (int x, int y, int width, int height, int startAngle, int spanAngle)
Coordinates can use QRectF input because QRectF qeal type, can accurate positioning, but because the integer input Angle, Angle will have deviation, this how to solve

CodePudding user response:

Input Angle is 1/16 of a degree of integer times, you say how big is the deviation? So clear?

CodePudding user response:

reference 1st floor matthewyeh response:
input Angle is 1/16 of a degree of integer times, you say how big is the deviation? So clear?

Enlarged obviously

CodePudding user response:

refer to the second floor chunxulele response:
Quote: refer to 1st floor matthewyeh response:
input Angle is 1/16 of a degree of integer times, you say how big is the deviation? So clear?

Very obviously enlarged


If you want to do the effect of level of cad, could better use opengl
  • Related