Hi Vladimir,

2010/12/16 Vláďa <[email protected]>:
> Dne 15.12.2010 14:21, Thomas Perl napsal(a):
>> 2010/12/15 user<[email protected]>:
>>> I followed the guide here:
>>>
>>> http://developer.qt.nokia.com/wiki/Selectable_list_of_Python_objects_in_QML
>>> to
>>> create a QAbstractListModel. This model is then forwarded to QML. So my
>>> first
>>> idea was to replace the model, but this resulted in a Python crash.
>>
>> If it crashes, chances are that the version of PySide you are using is
>> too old. Try to get the latest version from Git or the 1.0.0 beta1
>> release. The example works with that. If it still crashes with 1.0.0
>> beta1, please report it as a bug on http://bugs.openbossa.org/ in the
>> PySide product.
>>
> I use 1.0.0 beta1, the example works fine. But I tried to replace content of
> QML ListView by replacing QAbstractListModel with a new instance. This is
> probably a completely wrong idea of doing it and the reason why it crashed.

Do you keep a reference to your new instance in the Python world? Try
assigning it to a global variable so that a reference is kept to it in
Python land, and the object does not get deleted too early.

HTH.
Thomas
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to