In QML I want to use WebView , but the WebView.back does not work. Is there some way how to navigate, or do I have to store all the previous paths and navigate between them manualy using javascript function ?

1 Answer 1


You need to use WebView goBack() instead of just "back". The following code shows how to use it in a very minimal browser:

import QtQuick 2.0
import Ubuntu.Components 0.1
import QtWebKit 3.0

Rectangle {
    id: mainRect
    width: 1280
    height: 720
    Button {
        id: backButton
        text: "Back"
        onClicked: {
            if (webview.canGoBack) {
    WebView {
        id: webview
        url: "http://askubuntu.com"
        anchors {
            top: backButton.bottom
            bottom: mainRect.bottom
            left: mainRect.left
            right: mainRect.right

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.