Graphic Bug / Dissapearing Text in QWebView with overflow:auto in Div - Windows XP
-
wrote on 30 Jan 2014, 11:34 last edited by
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"));
webview->load(url);
@With a test.htm as:
@<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css" media="screen">
#myid {
font-size: 11px;
height: 200px;
overflow: auto;
width: 100%;
}
</style>
</head>
<body>
<div id="myid">
LOTS OF LINEBREAKS HERE SO THE 200PX ARE REACHED!
</div>
LOTS OF LINEBREAKS HERE
</body>
</html>@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!
Nikon
Picture #1: Start-View without Scrolling
!http://s14.directupload.net/images/140130/pptm2lq7.png!
Picture #2: after scrolling
!http://s7.directupload.net/images/140130/i2hirpgn.png!
Picture #3: after scrolling with text selection
!http://s7.directupload.net/images/140130/knbe7h6m.png! -
wrote on 30 Jan 2014, 14:16 last edited by
You could also simply try to visit this page:
http://stackoverflow.com/questions/17060966/restore-scrollbar-position-of-qwebview-after-sethtmlwith a qwebview and you'll see the bug aswell :/
2/2