Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.1
-
None
-
macOS 10.14.3
-
5a6a8509a96ef6795102422e217d609815d2f086 (qt/qtwebengine/dev)
Description
In our application, we're attempting to respond to the QWebEnginePage::selectionChanged signal in order to update a set of buttons to show the bold, underline, italics, etc., status of the current selection. In our slot, I ultimately call QWebEnginePage::runJavaScript and have code that waits for the callback to update a QHash. The wait code calls processEvents to keep things responsive while waiting.
In both the attached sample app and our real-world app, five calls are made to QWebEnginePage::runJavaScript, waiting for the callback to execute before making the next call (or timing out after five seconds). All five calls time-out. Then, suddenly all five QWebEnginePage::runJavaScript callbacks execute.
Notice that by pressing either of the "Run JavaScript" buttons in the sample app, everything works fine. It's only when calling QWebEnginePage::runJavaScript from within a slot that handles QWebEnginePage::selectionChanged (or for that matter, QWebEngineView::selectionChanged) that the app hangs.
To see the problem, compile and run the attached sample app. Double-click over some of the text in either text field. Watch the console to see the timeouts.