Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91565

canGoBack and canGoForward return wrong value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.4
    • 5.15.2, 5.15.3
    • WebEngine
    • None
    • c1ba8bdae978ffbdf55d95ce3b342b09bf6fb738 (qt/qtwebengine/5.15)

    Description

      It works as expected: the "Back" and "Forward" buttons become grayed at the right points. But, if one makes below actions:

      1. Go to any link
      2. Go to yet another link
      3. Click "Back" button
      4. Click "Go to Main Page"

      then both "Back" and "Forward" buttons are still enabled. And clicking on "Forward" button does nothing.

      Another issue appears when clicking directly on "Go to Main Page" the "Back" button stays disabled even though the initial page should be in the history.

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      import QtWebEngine 1.10
      
      Window {
          id: window
      
          width: 800
          height: 600
      
          WebEngineView {
              id: webEngineView
              anchors.fill: parent
              url: "https://doc.qt.io/qt-5/qml-qtwebengine-webenginehistory.html"
          }
      
          Row {
              Button {
                  id: mainPage
                  text: "Go to Main Page"
                  onClicked: webEngineView.url = "https://www.qt.io/"
              }
              Button {
                  id: back
                  enabled: webEngineView.canGoBack
                  text: "Back"
                  onClicked: webEngineView.goBack()
              }
      
              Button {
                  id: forward
                  enabled: webEngineView.canGoForward
                  text: "Forward"
                  onClicked: webEngineView.goForward()
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            juri.valdmann Jüri Valdmann (Inactive)
            henning Henning Gründl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes