Nominate our 2022 Qt Champions!

QML text scroll

  • Hello !

    I am using C++ and QML to create a nice interface. I would like to have a "console view", where plenty to text is printed through time. However, when the text of a text item or webview content grows, the view does not "scroll down".

    How can I make the text on the bottom of the text/webview item always stay visible ?

    I have tried playing with flickable and the_webview.evaluateJavaScript + window.scrollTo , but I could not get them to do what I want. This seems a fairly simple piece of UI, but I am having serious troubles to do it with QML.

    Thanks for you answer.

    ps: I also asked at but still waiting for a satisfying answer

  • On stackoverflow, there was an answer that inspired rodrigob to this:

    function scroll_to_bottom() {

    flickabe_item.contentY =
    Math.max(0, webview_item.height - flickabe_item.height)

    Just for reference. Would have been nice if you reported that back here as well, rodrigob.

Log in to reply