Tried your code, same error.

I'm just wondering if model.data(...) default role is not preventing something
to work in QStandardItemModel....

Stefan

> Le 16 avril 2014 à 23:08, Jonas Thiem <jonasth...@googlemail.com> a écrit :
>
>
> Hi,
>
> Trying to understand QStandardItemModel I came up with this:
>
> from PySide.QtCore import *
> from PySide.QtGui import *
>
> model = QStandardItemModel()
> model.invisibleRootItem().appendRow(QStandardItem("test"))
> assert(model.rowCount() == 1)
> assert(model.columnCount() == 1)
> mIndex = model.createIndex(0, 0)
> print(model.data(model.index(0, 0)))
> assert(model.itemFromIndex(mIndex) != None)
>
> The last assert fails with PySide 1.2.1 and Python 3.3.5 on Windows 7.
> Is that supposed to happen? What would be the proper approach to
> simply get the first most topleft item in a QStandardItemModel?
>
> Regards,
> Jonas Thiem
> _______________________________________________
> PySide mailing list
> PySide@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside
_______________________________________________
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to