How to set QGraphicsWebView background transparent?



  • I have background video playing or showing another application, then launch webapp which uses QGraphicsWebView. I would like to able to see the background application or video. How could I make QGraphicsWebView to have transparent background? QWebView works in that way, but I have not find a way to set with QGraphicsWebView. Thanks!



  • Something like this should do the job

    view->setStyleSheet("background:transparent");
    view->setAttribute(Qt::WA_TranslucentBackground);
    view->setAttribute(Qt::WA_OpaquePaintEvent, false);
    scene.setBackgroundBrush(QBrush(Qt::transparent));


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.