PDA

View Full Version : QWebView/QWebPage page scrolling problem with setContentEditable(true)



kiwidude
13th August 2012, 18:20
I am using Qt 4.7.4 on Windows. The problem is that as soon as you do page()->setContentEditable(true) in your QWebView control, then the control no longer scrolls correctly when you use the Page Up and Page Down keys. It jumps much too far in the document with each keypress making the paging next to useless.

You can replicate this just using the "previewer" example that ships with Qt just by adding this line somewhere in mainwindow.cpp:

centralWidget->webView->page()->setContentEditable(true);

Paste a large enough amount of text into the left side of the form to get a long document to test with and you will find that page up/down completely loses the plot.

Perhaps someone else out there has encountered this and/or knows of a workaround. My own googling proved fruitless... many, many thanks.