Hello Konstantin,

Is it possible to implement inserting stylesheet in Qtwebkit like
Qtwebengine
https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-stylesheetbrowser-example.html
?

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,
Ramakanth


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

>
>
> 03.12.2020, 08:44, "Ramakanth Kesireddy" <rama.k...@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
>
_______________________________________________
webkit-qt mailing list
webkit-qt@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-qt

Reply via email to