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

QWebEngineView crashes on "_blank" target and reimplemented createWindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.12.3
    • PySide
    • None
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            jonata Jonata Bolzan Loss
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes