Remove ScrollBars from QWebEngineView or QWebEnginePage

Is there a way to remove scrollbars from QWebEngineView or can i somehow get access to it's ScrollArea?

With webkit it was as easy as

WebView->page()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
WebView->page()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);

but i don't see any similar functionality within QWebEngine. I do not even see any scroll area within qwebengine sources.. Is there a something that i'm missing?

Update: I think i can try to force scrollbars disappear from some css settings that are passed with page for chromium


Changing css style of the webpage worked. I've used

<style type="text/css">
body {
    overflow:hidden;
}
</style>

but bad luck for those, who do not have access for css of the webpage you are trying to show the way you want.


Just set QWebEngineSettings::ShowScrollBars to false which is introduced in Qt 5.10

See QWebEngineSettings::WebAttribute

链接地址: http://www.djcxy.com/p/87854.html

上一篇: std :: set插入与初始化列表

下一篇: 从QWebEngineView或QWebEnginePage删除滚动条