Strange,
I'm pretty sure of the "QVariant" though, because I'm using it to expose a
custom model that inherits QAbstractListModel as a Qt Property like this :
model = QtCore.Property("QVariant", getModel, constant=True)
and it's working fine.
I've just tested to create a slot like yours (creating and returning an
instance of my custom model) in my minimal app and I have no segfault.
Maybe it's because you don't give your TargetListModel a parent. So you
create it and immediately return it but no one takes its ownership and it's
deleted to soon. This might explain the segfault.
What if you try to add this ? :
class TargetListModel(QtCore.QAbstractListModel):
def __init__(self, parent, targets):
QtCore.QAbstractListModel.__init__(self, parent)
@QtCore.Slot(int, int, result="QVariant")
def image_targets(self, frame, cam):
return TargetListModel(self,
[{'x': 100, 'y': 100},
{'x': 200, 'y': 200},
])
2013/1/13 Yosef Meller <[email protected]>
> **
>
> On Sunday 13 January 2013 11:02:55 Yann Lanthony wrote:
>
> > I think it should be :
>
> > @QtCore.Slot(int, int, result="QVariant")
>
>
>
> No, this just gives a segfault.
>
>
>
> _______________________________________________
> PySide mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/pyside
>
>
_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside