官方文档是这样说的
QModelIndex QSqlQueryModel::indexInQuery(const QModelIndex & item) const [virtual protected]
Returns the index of the value in the database result set for the given item in the model.
The return value is identical to item if no columns or rows have been inserted, removed, or moved around.
Returns an invalid model index if item is out of bounds or if item does not point to a value in the result set.