I'm using a QWebEngineView widget with PyQt5 and Python 3.6. I want to show progress, when a page is loading. For demonstration purposes I just do this using print statements (later I want to let a progress bar widget appear, show the progress and disappear when done).
I connected to the events loadStarted, loadProgress, loadFinished.
Code looks like this (self.browser is the QWebEngineView widget):
def loadStartedHandler(self):
print(time.time(), ": load started")
def loadProgressHandler(self, prog):
print(time.time(), ":load progress", prog)
def loadFinishedHandler(self):
print(time.time(), ": load finished")
# ....
self.browser.loadStarted.connect(lambda: self.loadStartedHandler())
self.browser.loadProgress.connect(lambda: self.loadProgressHandler(42))
self.browser.loadFinished.connect(lambda: self.loadFinishedHandler())
Now, of course, instead of the number 42 I would like to get the actual progress value of the loadProgress event. How do I get this?
Sorry, if this question is dumb. I'm a newbee and I just can't translate it to Python from the C++ documentation. (Unfortunately, I can't find decent Python docu for Qt.)