Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QWebView & QOpenGLwidget opacity issue
QtWS25 Last Chance

QWebView & QOpenGLwidget opacity issue

Scheduled Pinned Locked Moved Qt WebKit
transparent boddiv backgroundopacity
1 Posts 1 Posters 951 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Antoine
    wrote on last edited by
    #1

    Hi,

    Context

    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 :

    body{
    	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->setAutoFillBackground(false);
    this->setAttribute(Qt::WA_OpaquePaintEvent, false);//Remove opaque
    

    Please have you any idea how to manage this problem ?

    Thank you in adavance

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved