[webkit-qt] Qtwebkit 5.212 setuserstylesheet() is taking 7seconds time first time on startup

Ramakanth Kesireddy rama.kesi at gmail.com
Mon Dec 7 08:22:00 PST 2020

Hello Konstantin,

Is it possible to implement inserting stylesheet in Qtwebkit like

I had been trying to add an equivalent api of sample codes of inserting
stylesheet in the html QString but couldn't map the same.

Appreciate your feedback in this regard.

Best Regards,

On Thu, 3 Dec, 2020, 12:01 Konstantin Tokarev, <annulen at yandex.ru> wrote:

> 03.12.2020, 08:44, "Ramakanth Kesireddy" <rama.kesi at gmail.com>:
> > Question: Is there any API to reference the CSS file from page as the
> html is set dynamically using webview->setHtml() instead of
> setuserstylesheet?
> You can use standard way of loading external CSS in HTML, i.e. <link
> rel="stylesheet" type="text/css" ...>
> > Does it helps if we use QByteArray
> instead m_webView->settings()->setUserStyleSheetUrl(
> QUrl("data:text/css;charset=utf-8;base64," + css.toBase64())); where css
> being QByteArray object of the stylesheet?
> No, that would be worse.
> > Question: Where can we view or verify the QWebInspector output after
> setting the below codes in application source?
> > QWebPage *page =
> page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
> > QWebInspector *inspector = new QWebInspector;
> > inspector->setPage(page);
> QWebInspector is a widget which needs to be show by your app, e.g. as a
> separate window or inside a layout.
> If you are debugging on device you may want to use remote inspector
> instead. You need to set _q_webInspectorServerPort property on QWebPage
> object to desired port number (int), and connect to that port from your PC
> using WebKit-based browser.
> --
> Regards,
> Konstantin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20201207/009f80ed/attachment.htm>

More information about the webkit-qt mailing list