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

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.1, 5.13.1, 5.14.0, 5.15.15
    • 5.11.0, 5.11.1, 5.11.2
    • PySide
    • None
    • Windows 10 (64 bit)
      Python 3.6.6 (64 bit)
      PySide2 5.11.0, 5.11.1, or 5.11.2 (64 bit)
    • Windows
    • 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

        1. PYSIDE819_stacktrace.txt
          29 kB
          Alexandru Croitor

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              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