(PyQt5) Is there any way to call the method 'setUrl' (QWebEngineView object) through a thread?

228 Views Asked by At

I'm trying to call a method, QWebEngineView - 'setUrl' through a thread.
But it shows me an windows error(Application has stopped working).

ex) QWebEngineView side

class Main_UI(QWidget):
   ....
   self.web_view = QWebEngineView(self)
   ....

main_ui = Main_UI()

ex) Thread side (using asyncore)

class CustomThread(asyncore.dispatcher):
  ...
  main_ui.web_view.setUrl(QUrl("example.com"))
  ...

when the thread calls main_ui - web_view.setUrl,
it shows me an windows error.

thanks for reading this and I hope get good solution.

0

There are 0 best solutions below