Q3Painter Class Reference
|
Q3Painter () | |
Q3Painter ( QPaintDevice * pdev ) | |
void | drawArc ( const QRect & r, int a, int alen ) |
void | drawArc ( int x, int y, int w, int h, int startAngle, int spanAngle ) |
void | drawChord ( const QRect & r, int a, int alen ) |
void | drawChord ( int x, int y, int w, int h, int startAngle, int spanAngle ) |
void | drawEllipse ( const QRect & r ) |
void | drawEllipse ( int x, int y, int width, int height ) |
void | drawPie ( const QRect & r, int a, int alen ) |
void | drawPie ( int x, int y, int w, int h, int startAngle, int spanAngle ) |
void | drawRect ( const QRect & r ) |
void | drawRect ( int x, int y, int w, int h ) |
void | drawRoundRect ( const QRect & r, int xrnd = 25, int yrnd = 25 ) |
void | drawRoundRect ( int x, int y, int w, int h, int xrnd = 25, int yrnd = 25 ) |
The Q3Painter class is a Qt 3 compatibility wrapper for QPainter.
Prior to Qt 4, QPainter specialized the pen drawing for rectangle based functions (in particular: drawRect, drawEllipse, drawRoundRect, drawArc, drawChord and drawPie). When stroking a rectangle of width 10, the pen would draw a rectangle of width 10. Drawing a polygon defined by the corner points of the same rectangle the stroke would have a width of 11.
The reason for this is best explained using the picture below:
As we can see, stroking the rectangle so it gets a width of 10, means the pen is drawn on a rectangle on width 9. The polygon, however follows a consistent model.
In Qt 4, all rectangle based functions have changed to follow the polygon approach, which means that the rectangle defines the size of the fill, and the pen follows the edges of the shape. For pen widths of 0 and 1 this means that the stroke will be inside the shape on the left and the top and outside on the bottom and right.
The reason for the change in Qt 4 is so that we provide consistency for all drawing functions even with complex transformations.
Constructs a Q3Painter.
Constructs a Q3Painter that operates on device pdev.
Draws an arc defined by the rectangle r, the start angle a and the arc length alen.
The angles a and alen are 1/16th of a degree, i.e. a full circle equals 5760 (16*360). Positive values of a and alen mean counter-clockwise while negative values mean the clockwise direction. Ноль градусов соответствует 3-часовой отметке.
Пример:
QPainter p(myWidget);
p.drawArc(QRect(10,10, 70,100), 100*16, 160*16); // draws a "(" arc
See also drawPie() and drawChord().
Это перегруженная функция.
Draws the arc that fits inside the rectangle (x, y, w, h), with the given startAngle and spanAngle.
Draws a chord defined by the rectangle r, the start angle a and the arc length alen.
The chord is filled with the current brush().
The angles a and alen are 1/16th of a degree, i.e. a full circle equals 5760 (16*360). Positive values of a and alen mean counter-clockwise while negative values mean the clockwise direction. Ноль градусов соответствует 3-часовой отметке.
See also drawArc() and drawPie().
Это перегруженная функция.
Draws a chord that fits inside the rectangle (x, y, w, h) with the given startAngle and spanAngle.
Draws the ellipse that fits inside the bounds r using the current pen and brush.
Это перегруженная функция.
Draws an ellipse that fits inside the bounds specified by x, y, width and height using the current pen and brush.
Draws a pie defined by the rectangle r, the start angle a and the arc length alen.
The pie is filled with the current brush().
The angles a and alen are 1/16th of a degree, i.e. a full circle equals 5760 (16*360). Positive values of a and alen mean counter-clockwise while negative values mean the clockwise direction. Ноль градусов соответствует 3-часовой отметке.
See also drawArc() and drawChord().
Это перегруженная функция.
Draws a pie segment that fits inside the bounds (x, y, w, h) with the given startAngle and spanAngle.
Draws a rectangle that fits inside the rectangle r using the current pen and brush.
Это перегруженная функция.
Draws the rectangle that fits inside the bounds specified by x, y, w and h using the current pen and brush.
Draws a rounded rect that fits into the bounds r using the current pen and brush. The parameters xrnd and yrnd specifies the roundness in x and y direction.
Это перегруженная функция.
Draws a rounded rect that fits into the bounds x, y, w and h using the current pen and brush. The parameters xrnd and yrnd specifies the roundness in x and y direction.
Авторские права © 2010 Nokia Corporation и/или её дочерние компании | Торговые марки | Qt 4.6.4 |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |