Important: Please read the Qt Code of Conduct -

Graphic Bug / Dissapearing Text in QWebView with overflow:auto in Div - Windows XP

  • Hello Guys,

    i'm about to develop a small tool in Ordner to improve the usage of a website by saving some data and automizing some procedures (no, it's not a bot, it's really just a little browser tool).

    I thought every thing was done but then a received a message from a Windows XP user which i could verify afterwards:

    Using a Simple call like:
    webview = new QWebView(this);
    QDir dir;
    QUrl url = QUrl::fromLocalFile(dir.absolutePath().append("//test.htm"));

    With a test.htm as:
    @<!DOCTYPE html>
    <meta charset="utf-8">
    <style type="text/css" media="screen">
    #myid {
    font-size: 11px;
    height: 200px;
    overflow: auto;
    width: 100%;
    <div id="myid">

    Results in the following:
    Due to the fact that the Div's height is busted the div creates an own Scrollbar. In case you put enough Linebreaks after the Div, the QWebView will also display a scrollbar and by scrolling down some serious crazy bugs appear: The text in the Div becomes somehow static, but only the "image of the text" and not the text itself, because you can select the text where it should be, but it's displayed somewhere else. If you remove just enough lines so that the div has no scrollbar, everything works fine.

    Just in order to illustrate it, here are three pictures. One is taken before you start scrolling, the second screenshot shows the buggy situation in which the whole content is somehow "shifted" and the third one represents the fact, that you still can select the text where it should be.

    I hope you may have an idea how to fix that.

    I used QT 5.2.0 with mingw 32 bit under windows 7.

    Thanks for your help in advance!


    Picture #1: Start-View without Scrolling
    Picture #2: after scrolling
    Picture #3: after scrolling with text selection

  • You could also simply try to visit this page:

    with a qwebview and you'll see the bug aswell :/

Log in to reply