[Qt5-feedback] Add internalVariant to QModelIndex
Harald Fernengel
harald.fernengel at nokia.com
Tue Jul 12 13:29:45 CEST 2011
Hi,
On Tuesday 12 July 2011 13:16:10 ext Nils Jeisecke wrote:
> Currently you can only store either a pointer or a 64bit integer
> inside a QModelIndex.
>
> Depending on the data the model is wrapping it can sometimes be quite
> hard to store all required information in one of those elements.
>
> 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
That would require a non-trivial constructor, copy constructor and destructor
for QModelIndex, which we tried to prevent for performance reasons.
The QModelIndex is volatile and short-lived, so you can let it point to a
QVariant that is stored in your internal data structure.
Harald
More information about the Qt5-feedback
mailing list