Important: Please read the Qt Code of Conduct -

How to set at the end of verticalScrollBar in QWebView

  • Hello all, the problem is : scrollbar can't set at the end of QWebView. Look at screenshot;

    void MainWindow::WriteToWebView(QString szSrc) { QWebElement elDoc = ui->webView->page()->mainFrame()->documentElement();
               QWebElement elBody = elDoc.findFirst("body");
                    elBody.appendInside(szSrc + "<br /> ");
           //didn't work
           ui->webView->page()->mainFrame()->setScrollBarValue(Qt::Vertical, ui->webView->page()->mainFrame()->scrollBarMaximum(Qt::Vertical));

    How i can fix it?

  • so, the root of that problem - QWebElement. Fix it? - use setHtml or setContent. Thanks all. Question closed.

Log in to reply