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} } }
-
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? -
@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 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.