Hi Thomas,

I implemented the behavior that the model returns None if the UI requests items that do not exist. But as I expected I only got rid of the errors, but the incorrect behavior (not all items or empty items are shown) remains. I was hoping that Qt 4.7.2 might fix the problem, but it didn't change anything.

I do believe it is not bug in my code, but there is something wrong in either PySide or Qt/QML. Could someone confirm it?

I will be grateful for any suggestions. Thank you.

Vladimir

-------- Původní zpráva --------
Předmět: Re: [PySide] Strange behavior of QML ListView and QAbstractListModel
Datum:  Thu, 24 Feb 2011 12:01:07 +0100
Od:     Vláďa <[email protected]>
Komu:   Thomas Perl <[email protected]>
Kopie:  [email protected]



Hi Thomas,

thank you for the answer. I could change my code to implement this. But
the QML UI should never request data for item with index -1. Such item
doesn't exist. There should be two items with indexes 0 and 1.

So even if I changed my code so that it returns None, I would only
eliminate the error message, but it wouldn't solve my problem. I will
still get empty delegates.

Regards,
Vladimir

Dne 24.2.2011 11:48, Thomas Perl napsal(a):
 Hi Vláďa,

 2011/2/24 Vláďa<[email protected]>:
 [...] I think the most important information is that QML
 requests from QAbstractListModel item with index -1, which of course doesn't
 exist.
 In that case, your model should return None (in C++ one would return
 an empty/invalid(?) QVariant.

 HTH.
 Thomas

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

Reply via email to