企业如何通过vue小程序开发满足高效运营与合规性需求
750
2022-09-27
Qt wifi控件绘制
绘制方法:
QPainter painter(this); painter.save(); painter.setPen(Qt::NoPen); QLinearGradient bgGradient(QPointF(0, 0), QPointF(0, height())); bgGradient.setColorAt(0.0, QColor(0, 0, 0)); bgGradient.setColorAt(1.0, QColor(0, 0, 0)); painter.setBrush(bgGradient); painter.drawRect(rect()); painter.restore(); painter.translate(width()/2, height()*0.85); painter.setRenderHint(QPainter::Antialiasing, true);//绘制背景条 gradientArc(&painter, radius*0.8, 45, 90, arcHeight, qRgb(54, 54, 54)); gradientArc(&painter, radius*0.6, 45, 90, arcHeight, qRgb(54, 54, 54)); gradientArc(&painter, radius*0.4, 45, 90, arcHeight, qRgb(54, 54, 54)); gradientArc(&painter, radius*0.2, 45, 90, arcHeight, qRgb(54, 54, 54)); if(wifiQuality == 0){ }else if(wifiQuality == 1) { gradientArc(&painter, radius*0.2, 45, 90, arcHeight, qRgb(255, 255, 255)); }else if(wifiQuality == 2) { gradientArc(&painter, radius*0.4, 45, 90, arcHeight, qRgb(255, 255, 255)); gradientArc(&painter, radius*0.2, 45, 90, arcHeight, qRgb(255, 255, 255)); }else if(wifiQuality == 3) { gradientArc(&painter, radius*0.6, 45, 90, arcHeight, qRgb(255, 255, 255)); gradientArc(&painter, radius*0.4, 45, 90, arcHeight, qRgb(255, 255, 255)); gradientArc(&painter, radius*0.2, 45, 90, arcHeight, qRgb(255, 255, 255)); }else if(wifiQuality == 4) { gradientArc(&painter, radius*0.8, 45, 90, arcHeight, qRgb(255, 255, 255)); gradientArc(&painter, radius*0.6, 45, 90, arcHeight, qRgb(255, 255, 255)); gradientArc(&painter, radius*0.4, 45, 90, arcHeight, qRgb(255, 255, 255)); gradientArc(&painter, radius*0.2, 45, 90, arcHeight, qRgb(255, 255, 255)); } painter.translate(0, height()*0.05); painter.setBrush(QColor(255, 255, 255)); painter.drawEllipse(QPointF(0,0),arcLength,arcLength);
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~