标题:添加QWebEngineView,在QLabel上动态画图事件经过QWebEngineVie不显示
作者:zy1187074083
日期:2022-10-20 17:19
内容:
让QLabel与QWebEngineView叠加,QLabel设置最上层,且背景为透明。在Qlabel上的动态画图事件在经过QWebEngineView控件不显示画面。求解。
相关代码
//
map_view = new QWebEngineView(this);
// map_view->setStyleSheet("background-color:rgb(255,0,0)");
map_view->page()->load(QUrl("qrc:/map/MAP/MapShow/MapShow.html"));
map_view->setGeometry(0,0,400,400); map_view->lower();
//
QPainter paint_Sev(ui->label_3);
paint_Sev.setRenderHint(QPainter::Antialiasing);
QConicalGradient gradient;
gradient.setCenter(m_drawArea.center());
gradient.setAngle(85-t+180); //渐变与旋转方向恰好相反,以扇形相反的边作为渐变角度。
gradient.setColorAt(0.4,QColor(0,0,255,200));
gradient.setColorAt(0.8,QColor(0,0,255,0));
paint_Sev.setBrush(QBrush(gradient));
paint_Sev.setPen(Qt::NoPen);
if(bswitch){paint_Sev.drawPie(m_drawArea,(85-t)*16,5*16);}
//加载地图void frmMain::on_toolButton_map_clicked()
{bswitch_map = !bswitch_map;
if(bswitch_map == false)
{ui->label_3->setStyleSheet("background-color: rgb(0, 0, 0)");
ui->toolButton_map->setText("加载地图");
map_view->hide();}
else{
ui->label_3->setStyleSheet("background:transparent");
map_view->show(); ..
#1 [wanger233 10-26 17:09]
经过QWebEngineView控件不显示画面啥意思
我寻思吧网页放在上层不行吗 绘图自然就被挡住看不到