Qt World Summit: Register Today!

QWebView & QOpenGLwidget opacity issue

  • Hi,


    I am using a QWebView in front of a QGLWidget.

    The background of the QWebView is set to transparent, like this :

    this->setStyleSheet("background-color: transparent;");
    this->setWindowFlags(Qt::FramelessWindowHint); //No windowing
    this->setAttribute(Qt::WA_TranslucentBackground); // No background

    The background of the HTML page is also set to transparent in the CSS, like this :

    	background-color: rgba(255,255,255, 0) !important;
    	background:transparent !important;

    The need

    I want to create a DIV on the left of the HTML page with a background semi-transparent, like this:
    with the CSS property :

    background: rgba(255, 255, 255, 0.61);

    Normal result screenshot : Under Chrome

    Here my issue:
    When I am running the program, the background color is not set to white with a small opacity, here the result :

    Issue result screenshot : In the app

    I have tried this w/o any success :

    QPalette palette = this->palette(); //Get webView palette
    palette.setBrush(QPalette::Base, Qt::transparent);
    this->page()->setPalette(palette); //Set transparent palette
    this->setAttribute(Qt::WA_OpaquePaintEvent, false);//Remove opaque

    Please have you any idea how to manage this problem ?

    Thank you in adavance