Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-819

QWebEngineView crashes Python process if ancestor widget processes key events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.11.0, 5.11.1, 5.11.2
    • Fix Version/s: 5.12.1
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      Windows 10 (64 bit)
      Python 3.6.6 (64 bit)
      PySide2 5.11.0, 5.11.1, or 5.11.2 (64 bit)
    • Platform/s:
      Windows
    • Commits:
      5b72ec04f8da8d8f7f6988d6fdb49c9df9d069ee (qt/qtwebengine/5.12)

      Description

      Python process crashes in either of the following two conditions (or combinations thereof), and leaves an orphaned Qt_Qtwebengineprocess process running.

      To reproduce this bug execute the code under Condition 1 or Condition 2 below, bring the QWebEngineView widget into focus, then start pressing keys on the keyboard.

      Condition 1 - overridden keyReleaseEvent and/or keyPressEvent

      from PySide2 import QtCore, QtWidgets, QtWebEngineWidgets
      import sys
      
      class Dialog(QtWidgets.QDialog):
         def __init__(self):
            super().__init__()
            self.web = QtWebEngineWidgets.QWebEngineView(self)
            self.web.setUrl("http://google.com")
            self.web.resize(1024,768)
      
         def keyReleaseEvent(self, event):
            pass
      
         def keyPressEvent(self, event):
            pass
      
      if __name__ == '__main__':
         app = QtWidgets.QApplication(sys.argv)
         dlg = Dialog()
         dlg.show()
         dlg.exec_()
      

      Condition 2 - installed event filter

      from PySide2 import QtCore, QtWidgets, QtWebEngineWidgets
      import sys
      
      class Dialog(QtWidgets.QDialog):
         def __init__(self):
            super().__init__()
            self.web = QtWebEngineWidgets.QWebEngineView(self)
            self.web.setUrl("http://google.com")
            self.web.resize(1024,768)
            self.installEventFilter(self)
      
         def eventFilter(self, widget, event):
            return False
      
      if __name__ == '__main__':
         app = QtWidgets.QApplication(sys.argv)
         dlg = Dialog()
         dlg.show()
         dlg.exec_()
      

        Attachments

          Issue Links

          For Gerrit Dashboard: PYSIDE-819
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                alexandru.croitor Alexandru Croitor
                Reporter:
                munners David Munro-Ford
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes