As mentioned in https://bugreports.qt.io/browse/QTBUG-41960 , now it works, just using this line:
webEngineView->page()->setBackgroundColor(Qt::transparent);
I tried this in Qt 5.6 and it works well.
Refresh . To make this answer more useful, let me show all the relevant code.
In MainWindow, I installed this:
setAttribute(Qt::WA_TranslucentBackground); setAutoFillBackground(true); setWindowFlags(Qt::FramelessWindowHint);
For the webEngineView object webEngineView I set these attributes:
webEngineView->setAttribute(Qt::WA_TranslucentBackground); webEngineView->setStyleSheet("background:transparent"); webEnginePage = webEngineView->page();
Hope this helps.
source share