黄色区域:铅笔波束
构图思想:先刷黄色三角形,在刷黄色圆
//画波束,//小飞机->扇形区域->铅笔波束painter->save();{ int diameter = 26;//第一步先看画家当前坐标原点//测定(17,-2)坐标原点,向右为x正半轴,向下为y正半轴// painter->drawEllipse(17, -0, 10, 10);//第二步先用刷子刷出三角形区域// 设置画刷QBrush brush(QColor(220, 178, 152, 255)); // 设置画刷颜色为绿色brush.setStyle(Qt::SolidPattern); // 设置画刷样式为纯色填充painter->setBrush(brush); // 应用画刷// 创建并定义三角形QPolygon triangle;triangle << QPoint(17,0) << QPoint(17 - diameter / 2, -25 - diameter / 2) << QPoint(17 + diameter / 2, -25 - diameter / 2);// 绘制三角形painter->drawPolygon(triangle);//第三步刷子刷出一个圆圈,再画两条直线QPen pen;pen.setWidth(2);pen.setColor(QColor(234, 89, 1, 255));painter->setPen(pen);painter->setBrush(QColor(220, 178, 152, 255));painter->drawEllipse(17- diameter/2, -50, diameter, diameter);painter->drawLine(QPointF(17,0), QPointF(17-diameter/2,-25-diameter/2));painter->drawLine(QPointF(17, 0), QPointF(17 + diameter / 2, -25 - diameter / 2));}painter->restore();