Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngineView loadProgress not reading from 1 to 100
QtWS25 Last Chance

QWebEngineView loadProgress not reading from 1 to 100

Scheduled Pinned Locked Moved Unsolved QtWebEngine
4 Posts 2 Posters 710 Views
  • 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.
  • U Offline
    U Offline
    Uzosky
    wrote on last edited by Uzosky
    #1

    Hello,
    According to QTQuick/QML QWebEngineView loadProgess documentation, loading progress is supposed to be in the range of 1 to 100, but when I connect it to a progressBar, i see the value jumps from 0 to 100 without any transitional value like 0 -> 20 -> 60 -> 100. Please, I'm new to QT, how can I solve this problem.
    Here is the code:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtWebEngine 1.8
    import QtQuick.Controls 2.3
    
    Window {
    	id: main_window
    	width: 1366
    	height: 768
    	color: "#cc1515"
    	visible: true
    	visibility: Window.FullScreen
    	title: qsTr("Web Viewer")
    
    	WebEngineView {
    		id: web_viewer
    		anchors.fill: parent
    		url: "https://qt.io"
    		opacity: 1
    	}
    
    	ProgressBar {
    		id: progress_bar
    		from: 0
    		to: 100
    		value: 50
    		width: 400
    		height: 18
    		clip: false
    		padding: 2
    	}
    
    	Connections {
    		target: web_viewer
    		onLoadingChanged: {progress_bar.value = web_viewer.loadProgress}
    	}
    }
    
    JonBJ 1 Reply Last reply
    0
    • U Uzosky

      Hello,
      According to QTQuick/QML QWebEngineView loadProgess documentation, loading progress is supposed to be in the range of 1 to 100, but when I connect it to a progressBar, i see the value jumps from 0 to 100 without any transitional value like 0 -> 20 -> 60 -> 100. Please, I'm new to QT, how can I solve this problem.
      Here is the code:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtWebEngine 1.8
      import QtQuick.Controls 2.3
      
      Window {
      	id: main_window
      	width: 1366
      	height: 768
      	color: "#cc1515"
      	visible: true
      	visibility: Window.FullScreen
      	title: qsTr("Web Viewer")
      
      	WebEngineView {
      		id: web_viewer
      		anchors.fill: parent
      		url: "https://qt.io"
      		opacity: 1
      	}
      
      	ProgressBar {
      		id: progress_bar
      		from: 0
      		to: 100
      		value: 50
      		width: 400
      		height: 18
      		clip: false
      		padding: 2
      	}
      
      	Connections {
      		target: web_viewer
      		onLoadingChanged: {progress_bar.value = web_viewer.loadProgress}
      	}
      }
      
      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @uzosky
      I suspect the progress is happening so fast (how long does it take anyway?) that UI does not have time to update or you do not have time to see? Have a look at https://stackoverflow.com/questions/33667292/qml-progress-in-the-progressbar-is-jump to see if the reply there helps your case?

      U 1 Reply Last reply
      0
      • JonBJ JonB

        @uzosky
        I suspect the progress is happening so fast (how long does it take anyway?) that UI does not have time to update or you do not have time to see? Have a look at https://stackoverflow.com/questions/33667292/qml-progress-in-the-progressbar-is-jump to see if the reply there helps your case?

        U Offline
        U Offline
        Uzosky
        wrote on last edited by
        #3

        @jonb Thanks for your response, I tested it on a slow network that takes about 3 to 5 secs to load, yet no transition. I'll try out the link.

        1 Reply Last reply
        0
        • U Offline
          U Offline
          Uzosky
          wrote on last edited by
          #4

          @JonB I adapted the code in the link you provided. It's really cool in simulating a smooth transition to trick the eyes that the page is loading from 1 to 100. But it doesn't help the onLoadingChanged connection in updating the loading progress status of the Qwebengineview.

          1 Reply Last reply
          0

          • Login

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