Possible bug in Qt code. Testing

David Faure faure at kde.org
Sun Dec 10 13:41:42 GMT 2006


On Saturday 09 December 2006 16:30, Rafael Fernández López wrote:
>         QHash<int, QVariant> *newData = new QHash<int, QVariant>();
>         QPersistentModelIndex newIndex(createIndex(row, 0, newData));

As I said on IRC, this is really the wrong way to write a model. Don't store data into persistent indexes,
store data into whatever memory structure you'd like, as a member of the model.
See the model examples in $QTDIR/examples/modelview.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list