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

QWebEngineView crashes on "_blank" target and reimplemented createWindow

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      I was trying to reimplemnt createWindow because of some "_blank" links that I want to force to be opened on the same view. Here is a sample code:

       

      import sys
      from PySide2.QtWidgets import QApplication, QDialog, QLineEdit, QPushButton
      from PySide2.QtCore import QUrl, Qt
      from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage
      
      class Form(QDialog):
          def __init__(self, parent=None):
              super(Form, self).__init__(parent)
              self.setWindowTitle("QWebEngine test")
      
              class MyWebEngineView(QWebEngineView):
                  def createWindow(self, windowType):
                      return self
      
              self.webview = MyWebEngineView(parent=self)
              self.webview.setGeometry(0,0,self.width(),self.height())
              self.webview.load(QUrl('https://duckduckgo.com/?q=cat&iar=images'))
      
      if __name__ == '__main__':
          app = QApplication(sys.argv)
          #app.setAttribute(Qt.AA_UseSoftwareOpenGL)
          form = Form()
          form.show()
          sys.exit(app.exec_())
      
      

       

      When you click on an image to open it, it crashes.

        Attachments

        1. 2019-05-27-163707_640x480_scrot.png
          2019-05-27-163707_640x480_scrot.png
          350 kB
        2. 2019-05-27-163713_640x480_scrot.png
          2019-05-27-163713_640x480_scrot.png
          432 kB
        3. Peek 2019-05-27 18-13.webm
          683 kB
        4. pyside-1011.py
          0.8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              crmaurei Cristian Maureira-Fredes
              Reporter:
              jonata Jonata Bolzan Loss
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes