Details
-
Bug
-
Resolution: Moved
-
P2: Important
-
None
-
4.7.0
-
None
Description
I have a WebView embedded inside a Flickable, and I'm trying to move the
page appropriately when a user clicks on a link that's an anchor to the
same page, such as:
<a href="#references">Jump to References</a>
I looked at the source code in demos/declarative/webbrowser, but I fear
that they may have forgotten about the use of links for that purpose,
since the code in FlickableWebView looks like:
(...)
onUrlChanged: {
// got to topleft
flickable.contentX = 0
flickable.contentY = 0
if (url != null)
}
(...)
contentY shouldn't typically be set to 0 if the url changes just by the
anchor part (i.e. from http://www.example.com#section1 to
http://www.example.com#section2). My question is: Does the QML WebView
element exposes enough of its state in its API so that we can actually
scroll to the right place on the page ? If not, shouldn't we submit a
bug report or feature request ?
Example:
Use the demos/declarative/webbrowser QML example and visit
http://en.wikipedia.org/wiki/Uniform_Resource_Locator
... and try any of the "Contents" link: Instead of scrolling to the
right place on the page, it will go back to the top of the document.
Attachments
Issue Links
- depends on
-
QTBUG-13451 Support property versioning in QML
- Closed