PDA

View Full Version : QModelIndex question



waynew
10th February 2010, 00:28
Could someone please explain this to me?

QModelIndex QSqlQueryModel::indexInQuery ( const QModelIndex & item ) const [protected]

Returns the index of the value in the database result set for the given item in the model.

What is meant by & item ???
It's obviously not a database field value, as that is not compiling.

And what is the relationship between the record data in the model and the model index?
What if the user changes the record sort order. What then?

ecanela
10th February 2010, 01:03
read the follow link, contain the base of the model view programming
http://doc.trolltech.com/4.4/model-view-programming.html

QtSql is building on top of this model view framework
http://doc.trolltech.com/4.4/qtsql.html

waynew
10th February 2010, 01:53
Thanks I'll check it out.