We have subs-classed QStandardItem, and QStyledItemDelegate in several places. At some point it became convenient to grab the item directly from a QModelIndex. This could have been accomplished via index.model().itemFromIndex(index). It could have also been avoided completely with multiple calls to data() to different UserRoles. Although that incurred some performance cost.
I'll gladly admit its a bit odd, in fact I don't particularly like it myself, but for the meantime I'm stuck with it. Oddities aside, I suspect that it wasn't intentional that this stopped working. - Steve On Wed, Jan 18, 2012 at 09:41:13PM +0100, S. Champailler wrote: > Gasp ! > > Just out of curiosity, why would you need to do that ? > I really wonder because I use the setData a lot but I've never done nor > needed that. > > Stefan > > > > On Wed, Jan 18, 2012 at 09:42:04AM -0600, Steve Kacsmark wrote: > > Prior to v1.1.0 it was possible to store and retrieve QStandardItems > > using QStandardItem's own setData() and data methods. Starting with > > v1.1.0 data() will return None, instead of the stored item. > > > > Essentially, the following code will print 'None' in PySide 1.1.0, and > > '<PySide.QtGui.QStandardItem object at 0xnnnnnnnn>' in earlier versions. > > > > item = QStandardItem() > > item.setData(item) > > print item.data() > > > > - Steve > > _______________________________________________ > > PySide mailing list > > [email protected] > > http://lists.pyside.org/listinfo/pyside > _______________________________________________ > PySide mailing list > [email protected] > http://lists.pyside.org/listinfo/pyside _______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
