poser
3rd December 2010, 18:20
I’m trying to add a default style to every rendered webpage in my browser. I’ve tried many different things and can’t get the DOM to change. I’m using Qt 4.7.0 on Windows with VS. I believe the following should work, but the DOM doesn’t get modified. Any thoughts?
void QWebView::onLoadFinished(bool error)
{
QWebElement style;
style.setOuterXml("<style>*:focus{outline:1px solid red}</style>");
style.setAttribute("type", "text/css");
page()->mainFrame()->findFirstElement("head").appendInside(style);
}
void QWebView::onLoadFinished(bool error)
{
QWebElement style;
style.setOuterXml("<style>*:focus{outline:1px solid red}</style>");
style.setAttribute("type", "text/css");
page()->mainFrame()->findFirstElement("head").appendInside(style);
}