Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault in QStandardItemModel #147

Open
astrofrog opened this issue Jun 14, 2016 · 1 comment
Open

Segmentation fault in QStandardItemModel #147

astrofrog opened this issue Jun 14, 2016 · 1 comment

Comments

@astrofrog
Copy link

astrofrog commented Jun 14, 2016

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants