Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How can i show loading icon/gif while the page is loading in webview ?
Forum Updated to NodeBB v4.3 + New Features

How can i show loading icon/gif while the page is loading in webview ?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • QjayQ Offline
    QjayQ Offline
    Qjay
    wrote on last edited by
    #1

    Hello , i want to show a animated gif or just a simple text to show that page is being loaded .

    for ex : i am opening some site till the site is fully loaded show some loading bar or gif that the page is loading

    qml code that i am using :

    WebView {
            id: webView
            anchors.fill: parent
            url: "http://somesite.com"
    
        }
    
    YashpalY 1 Reply Last reply
    0
    • QjayQ Qjay

      Hello , i want to show a animated gif or just a simple text to show that page is being loaded .

      for ex : i am opening some site till the site is fully loaded show some loading bar or gif that the page is loading

      qml code that i am using :

      WebView {
              id: webView
              anchors.fill: parent
              url: "http://somesite.com"
      
          }
      
      YashpalY Offline
      YashpalY Offline
      Yashpal
      wrote on last edited by
      #2

      @Qjay You can use loading property and loadingChanged() signal of Webview to play with your loading animation. Further, you can use loadProgress property to show the progress as well.

      QjayQ 1 Reply Last reply
      2
      • YashpalY Yashpal

        @Qjay You can use loading property and loadingChanged() signal of Webview to play with your loading animation. Further, you can use loadProgress property to show the progress as well.

        QjayQ Offline
        QjayQ Offline
        Qjay
        wrote on last edited by
        #3

        @Yashpal Hey man , can you provide 1 simple example for it !!

        thanks !!

        1 Reply Last reply
        1
        • YashpalY Offline
          YashpalY Offline
          Yashpal
          wrote on last edited by
          #4

          You can do something like this.

          WebView {
                  id: webView
                  anchors.fill: parent
                  url: "http://somesite.com"
          }
          
          BusyIndicator{
                  anchors.centerIn: parent
                  running: webView.loading === true
          }
          

          or

          WebView {
                  id: webView
                  anchors.fill: parent
                  url: "http://somesite.com"
                  onLoadingChanged: {
                          if(loading === true) //start animation
                          else
                          if(loading === false) //stop animation
                          else { /*do nothing*/ }
                }
          }
          
          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved