Results 1 to 1 of 1

Thread: QWebView Win XP: Scroll Bug - Text dissappears / wrong position

  1. #1
    Join Date
    Jan 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QWebView Win XP: Scroll Bug - Text dissappears / wrong position

    Hello Guys,

    i asked the same question in another forum, but i hope no one takes offense by this "double post". It's just to contact maximum amount of people :P If there is a way to solve the problem i'll spread it in the other forum, so people can use the solution aswell.

    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 everything was done but then a received a message from a Windows XP user which i could verify afterwards:

    Using a Simple call like:
    Qt Code:
    1. webview = new QWebView(this);
    2. QDir dir;
    3. QUrl url = QUrl::fromLocalFile(dir.absolutePath().append("//test.htm"));
    4. webview->load(url);
    To copy to clipboard, switch view to plain text mode 

    With a test.htm as:
    Qt Code:
    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8">
    5. <style type="text/css" media="screen">
    6. #myid {
    7. font-size: 11px;
    8. height: 200px;
    9. overflow: auto;
    10. width: 100%;
    11. }
    12. </style>
    13. </head>
    To copy to clipboard, switch view to plain text mode 

    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

    Picture #2: after scrolling

    Picture #3: after scrolling with text selection



    Added after 42 minutes:


    You could also simply try to visit this page:
    http://stackoverflow.com/questions/1...-after-sethtml

    with a qwebview and you'll see the bug aswell :/
    Last edited by nikon; 30th January 2014 at 14:18.

Similar Threads

  1. Tooltip Displaying on the wrong position
    By nekkro-kvlt in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2012, 09:29
  2. Replies: 0
    Last Post: 22nd May 2011, 22:34
  3. QScrollArea scroll bars wrong size
    By koan in forum Qt Programming
    Replies: 4
    Last Post: 26th November 2010, 14:10
  4. mouseMoveEvent contains wrong position?
    By draftpunk in forum Qt Programming
    Replies: 10
    Last Post: 12th September 2008, 01:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.