Important: Please read the Qt Code of Conduct -

How to clear the contents in the QWebView when clicking on a button to go back to the mainpage?

  • Hi all,
    I am working on an application where i am in need of help:

    I am having a button in the main page.qml(main window) and when i click on it,it must go to the next page(.qml) where i have a webview as such:


    import QtQuick 1.0
    import 1.1
    import QtWebKit 1.0

    Page {
    id: ab
    x: 0
    y: 0

    Flickable {
        width: 300; height: 600
        contentWidth: hg.width; contentHeight: hg.height
    WebView {
        url: ""
        preferredHeight: 600
       preferredWidth : 360
        smooth: false



    and in the click event i am having:


    onJobsClicked: {
    if (currentPage != "jobs")

            currentPage = "jobs"
            header.headerText = "Jobs"
            jobsPage.visible = true
            stateIndexProperty = 2
            tab.visible = false


    JobsPage {
    id: jobsPage
    visible: false header.bottom
    width: screenWidth
    anchors.bottom: parent.bottom


    Clicking on the jobs button,its redirects me to the particular abc.qml,and displays the url.When i press the back button it does not clear the contents of the page.As a result,both page contents gets overlapped.When i flick it i can see the main page at back side.

    Anyone Please provide the solution for this?


Log in to reply