Should return invalid QModelIndex since inserted row does not map to
query.
Change-Id: Ib1d15cf4198a7063717fb3f3b594b2b1d8a54dfe
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
QModelIndex QSqlTableModel::indexInQuery(const QModelIndex &item) const
{
Q_D(const QSqlTableModel);
+ if (d->cache.value(item.row()).op() == QSqlTableModelPrivate::Insert)
+ return QModelIndex();
+
const int rowOffset = d->insertCount(item.row());
return QSqlQueryModel::indexInQuery(createIndex(item.row() - rowOffset, item.column(), item.internalPointer()));
}