Hi all,
QWebView::paintEvent(event);
p.
setCompositionMode(QPainter::CompositionMode_Clear);
p.fillRect(10, 10, 100, 100, Qt::transparent);
}
void WebView::paintEvent(QPaintEvent *event){
QWebView::paintEvent(event);
QPainter p(this);
p.setCompositionMode(QPainter::CompositionMode_Clear);
p.fillRect(10, 10, 100, 100, Qt::transparent);
}
To copy to clipboard, switch view to plain text mode
I override the paintEvent on WebView, so that the transparent window can be made.
My question is that all the element within this window are cleared. I want my web element in website overlay on top of this window.
For example, my website has transparent body, and I have a <div> with alpha 0.5. When the div overlay on the transparent window, all things are cleared within window.
What I want to do is showing this div with alpha 0.5.
Do you guy have any suggestions? I doubt that the solution can be solved by swap the position of QWebView:
aintEvent(event); to the end, such that
p.
setCompositionMode(QPainter::CompositionMode_Clear);
p.fillRect(10, 10, 100, 100, Qt::transparent);
QWebView::paintEvent(event);
}
void WebView::paintEvent(QPaintEvent *event){
QPainter p(this);
p.setCompositionMode(QPainter::CompositionMode_Clear);
p.fillRect(10, 10, 100, 100, Qt::transparent);
QWebView::paintEvent(event);
}
To copy to clipboard, switch view to plain text mode
But it make a segfault.
Bookmarks