Jump to content

Qt WebEngineView in Python panel "pauses" when hidden


GeordieM

Recommended Posts

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?

TNKS!

G

Edited by GeordieM
Link to comment
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.

 

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...