On Wednesday 05 April 2006 01:33 am, you wrote:
> Hello Ian,
> QModelIndex only provides a data() function because it is a temporary
> object. The documentation says that you should never save that indices.
> The model has a setData() function where you have a QModelIndex
> parameter and the data as QVariant.
> Use this function...
Yes, you are correct at least in syntax ;) Unfortunately the point is that my
question was more into why isn't there a setData method on the QModelIndex.
The issue you have is that sometimes you dont know what your model is if you
are in a method that is ONLY dealing with the QModelIndex. Temporary or not,
it will still be around long enough to read, and in my case write. Currently
what I am forced to do is
Looks wrong, right ;) But the alternative is storing BOTH the source model
and the index. Keep duplicate data in sync, and worse, store a pointer to
an object I only need for one method in a class. Even more annoying, all of
my methods that update the view must take both the index and the model.
-ian reinhart geiser
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/