Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QWebEngineView loadProgress not reading from 1 to 100



  • 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}
    	}
    }
    


  • @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?



  • @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.



  • @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.


Log in to reply