[Qt5-feedback] Add internalVariant to QModelIndex

Christoph Feck christoph at maxiom.de
Tue Jul 12 14:48:03 CEST 2011


On Tuesday 12 July 2011 13:16:10 Nils Jeisecke wrote:
> Hi!
> 
> Currently you can only store either a pointer or a 64bit integer
> inside a QModelIndex.

QModelIndex is not used to store anything, but acts as a kind of "pointer" to 
actual model data. I doubt it makes sense to add weight to it, because indexes 
are passed around a lot.

> Depending on the data the model is wrapping it can sometimes be quite
> hard to store all required information in one of those elements.

Can you give us a use case?

> What do you think, would it be reasonable to add something like
> internalVariant to QModelIndex?
> 
> QVariant QModelIndex::internalVariant() const
> QModelIndex QAbstractItemModel::createIndex(int row, int column, const
> QVariant &) const
> 
> Nils
> _______________________________________________
> Qt5-feedback mailing list
> Qt5-feedback at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback


More information about the Qt5-feedback mailing list