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

QComboBox Python user data crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.11.0
    • PySide

    Description

      QComboBox crashes when inserting a custom Python user data type:

      On Linux, qt 5.11, pyside2 latest git branch 5.11.

       

      from PySide2 import QtWidgets
      
      class Data(object):
          """
          Test class to store in userData. The _getitem_ is needed in order to
          reproduce the segmentation fault.
          """
          def _getitem_(self, item):
              raise ValueError("Failing")
      
      qapp = QtWidgets.QApplication.instance()
      if qapp is None:
          qapp = QtWidgets.QApplication([''])
      
      data1 = Data()
      
      widget = QtWidgets.QComboBox()
      widget.addItem('a', data1)

       

      Taken from https://github.com/spyder-ide/qtpy/blob/master/qtpy/tests/test_patch_qcombobox.py

       

      There are many reports for QComboBox, none look like this one.

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            jschueller Julien Schueller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes