qt5.9开发指南 例子
painter.setWindow(-100,-100,200,200);
void QPainter::setWindow(int x, int y, int width, int height)
This is an overloaded function.
Sets the painter’s window to the rectangle beginning at (x, y) and the given width and height.
端点为(-100,-100)
宽度和高度为200和200

painter.drawEllipse(QPoint(50,0),50,50);
void QPainter::drawEllipse(const QPointF ¢er, qreal rx, qreal ry)
This is an overloaded function.
Draws the ellipse positioned at center with radii rx and ry.
This function was introduced in Qt 4.4.
第一个点是圆心
第二个和第三个为半径
椭圆 和圆的绘制方法
for(int i=0; i<2;i++)
{
painter.drawEllipse(QPoint(50,0),50,50);
painter.rotate(10);
}

for(int i=0; i<6;i++)
{
painter.drawEllipse(QPoint(50,0),50,50);
painter.rotate(10);
}

for(int i=0; i<36;i++)
{
painter.drawEllipse(QPoint(50,0),50,50);
painter.rotate(10);
}

Qt5.9开发:椭圆与圆的绘制例子
博客围绕Qt5.9开发展开,给出了绘制椭圆和圆的例子。介绍了`painter.setWindow`函数设置绘图窗口,以及`painter.drawEllipse`函数绘制椭圆,说明了函数参数含义,如端点、宽度、高度、圆心和半径等。
1536

被折叠的 条评论
为什么被折叠?



