pyside / PySide

ATTENTION: This project is deprecated, please refer to PySide2
https://wiki.qt.io/PySide2
GNU Lesser General Public License v2.1
291 stars 66 forks source link

Segmentation fault in QStandardItemModel #147

Open astrofrog opened 8 years ago

astrofrog commented 8 years ago

The following example causes a segmentation fault:

from PySide import QtGui
from PySide.QtCore import Qt

class Data(object):
    def __getitem__(self, item):
        raise ValueError("Issue")

model = QtGui.QStandardItemModel()

item = QtGui.QStandardItem('a')
item.setData(Data(), role=Qt.UserRole)

model.appendRow(item)
model.item(0)

Somehow, the getitem which raises an exception is needed to reproduce the failure. if instead of raising an exception I do:

class Data(object):
    def __getitem__(self, item):
        return 1

then the script is stuck.

techtonik commented 8 years ago

It might have better chances to be spotted if reported here - https://bugreports.qt.io/browse/PYSIDE