Jump to content
Sign in to follow this  

Qt WebEngineView in Python panel "pauses" when hidden

Recommended Posts

Posted (edited)

Hi all, I'm creating a python panel tool with a web front end.  I've successfully put a Qt WebEngineView in a Python panel, but when the panel is hidden and displayed again (ie switching tabs in Houdini UI) the main loop of WebEngineView seems to pause.  Any animations stop and all mouse/keyboard interaction stops.  If I resize the panel it will recover most of the time.  I assume I have to call something on WebEngineView when then the python panel onActivateInterface() is called but I can't see anything obvious in the Qt docs http://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html#WebAction-prop

PS: I'm on Win 10.

Anyone solved this before?



Edited by GeordieM

Share this post

Link to post
Share on other sites

Small update, I can get WebEngineView to start updating by calling: 

self.resize(self.width()-1, self.width()-1) 
self.resize(self.width(), self.width())

Here my class inherits from QtWebEngineWidgets.QWebEngineView.

BUT as soon as the mouse enters the QWebEngineView control it freezes again.


Share this post

Link to post
Share on other sites

So this is a focus related issue but haven't worked out a good callback to use.  But have worked out a slightly dodgy solution.  Instead of inheriting from QWebEngineView directly I inherit from QWidget and then add a QWebEngineView.  I then listen for the timerEvent event on the python panel and call QWebEngineView.update() every 0.5 seconds.  This works well but probably not the best solution.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this