[webkit-qt] WebView with Transparent Background
mike at mikeditum.co.uk
Mon Nov 8 11:10:09 PST 2010
I'm quite new to Qt and am planning on using it for an upcoming project. I'm
currently just writing small test programs that implement each bit of
functionality I need before I throw myself into properly learning Qt, so
apologies if this is a bit of a newbie question.
I'm currently trying to get a webkit widget with a transparent background so
that if, in an HTML document, the html and body nodes are styled to have
their background-color set to transparent then the Widgets behind the
WebView Widget are visible through. I've had a play myself, browsed the API
documentation and done some searching and come up with a couple of things
but nothing has worked properly so far.
This is the code I have currently:
int main(int argc, char *argv)
QApplication app(argc, argv);
QWebView *view = new QWebView(&window);
QPalette pal = view->palette();
view->setGeometry(10, 10, 1260, 680);
and the HTML document I'm displaying:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
<meta http-equiv="Content-Type" content="text/html;
This does makes some bits transparent, unfortunately it also seems to make
the parent QWidget window transparent as well and just shows the console
window beneath the window. How do I go about making just the QWebView's
Thanks for any help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-qt