Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Qt 5.0 transparent background QWebView above QWidget with video

$
0
0
Hello! I can not get a QWebView with a html code to be transparent when it is on top of a QWidget with a video running. Any tips to fix that? I found nothing on web and I read something about QGraphicsView but no success at all. code: int main(int argc, char *argv[]) {       QApplication app(argc, argv);       QWidget window;     window.resize(500, 500);     window.setStyleSheet("background-color: blue;");     window.setWindowTitle("qt-vlc-webview");       const char* file = "/home/vntsyne/Documents/avatar_60.mkv";     QVlcPlayer player(&window);     player.setGeometry(0, 0, 500,500);     player.playFile(file);       QWebView *view = new QWebView(&window);       QPalette pal = view->palette();     pal.setBrush(QPalette::Base, Qt::transparent);     view->page()->setPalette(pal);       view->setStyleSheet("background:transparent;");     view->setAttribute(Qt::WA_OpaquePaintEvent, false);       view->setHtml("<body >"                   "<h1 >Test</h1></body>");       view->setGeometry(200, 200, 100, 100);       window.show();       return app.exec(); } Screenshot from video: [imageshack.us]

Viewing all articles
Browse latest Browse all 18427

Trending Articles