[Webkit-unassigned] [Bug 29414] New: [Qt] [Regression] Transparent QWebView
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 18 07:36:09 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=29414
Summary: [Qt] [Regression] Transparent QWebView
Product: WebKit
Version: 528+ (Nightly build)
Platform: Other
OS/Version: Mac OS X 10.5
Status: NEW
Keywords: Qt
Severity: Normal
Priority: P2
Component: New Bugs
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: vestbo at webkit.org
This bug report originated from issue QTBUG-3706
<http://bugreports.qt.nokia.com/browse/QTBUG-3706>
--- Description ---
The result of the code below is a fully-transparent background in the HTML
page, so that one can overlay it over an existing widget background. This
worked in Qt 4.4.3, but not anymore in 4.5.0. The page renders with a solid
white background instead.
Test case (needs an image):
//----------------------------------------------------
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *widget = new QWidget;
widget->setStyleSheet("QWidget {background: url(background.png)}");
QVBoxLayout *vbox = new QVBoxLayout(widget);
QWebView *webView = new QWebView;
vbox->addWidget(webView);
QPalette p = webView->palette();
p.setColor( QPalette::Dark, Qt::transparent );
webView->setPalette(p);
p = webView->page()->palette();
p.setColor( QPalette::Window, Qt::transparent );
webView->page()->setPalette(p);
webView->setHtml("<body style='background: rgba(0,0,0,0)'>"
"<h1 style='color:white'>Test</h1></body>");
widget->show();
return a.exec();
}
//----------------------------------------------------
--- Comments ---
Note: qtuser: 03/09/09 03:32:05 PM:
Here's a fix/workaround for this issue:
The difference between Qt 4.4 and 4.5 is that in Qt 4.4, the background is
first filled with QPalette::Dark by the QWebView followed by QPalette::Window
by the QWebPage. In Qt 4.5, the page background is only filled with the
QPalette::Base color. Making that color transparent in the palette of the
QWebView allows the page to be transparent again. However, a small change to
the Qt source is also necessary in order for painting to work properly:
In the file src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp, in
QWebView::setPage(), remove the following line:
setAttribute(Qt::WA_OpaquePaintEvent, d->page);
I would say the 4.5 behavior is better. It's just different from 4.4 -- but
maybe nobody else was doing transparent QWebViews, so I'd rather stick with the
4.5 behavior (with the above fix).
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list