From 76418628f14ff555242d7819e6cbcc6191c44360 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 9 Feb 2012 15:33:43 +0100 Subject: QSqlTableModel: deduplicate and optimize counting of inserts Reading STL iteration code is painful enough if you only have to do it once. Thiago suggested remembering the end iterator for performance. Change-Id: Ic2cdc480f591932ea420e692a4d2796d49f05313 Reviewed-by: Yunqiao Yin --- src/sql/models/qsqltablemodel_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sql/models/qsqltablemodel_p.h') diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h index 8649a91e53..c2e4442a6b 100644 --- a/src/sql/models/qsqltablemodel_p.h +++ b/src/sql/models/qsqltablemodel_p.h @@ -79,6 +79,7 @@ public: virtual void revertCachedRow(int row); virtual int nameToIndex(const QString &name) const; QString strippedFieldName(const QString &name) const; + int insertCount(int maxRow = -1) const; void initRecordAndPrimaryIndex(); QSqlDatabase db; -- cgit v1.2.3