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);
}