QSqlTableModel/QSqlQueryModel and insertColumns problem.
authorMichael Goddard <michael.goddard@nokia.com>
Tue, 2 Nov 2010 02:14:03 +0000 (12:14 +1000)
committerJason McDonald <jason.mcdonald@nokia.com>
Wed, 9 Feb 2011 07:12:39 +0000 (17:12 +1000)
commita7b953fb6f246f3d61723872ac97a1721fece128
treecdc105b9c81716caf31691be386a34b4a2cf72f3
parente8eea4ed6a09a4adbf3850a6943b50b9817122f8
QSqlTableModel/QSqlQueryModel and insertColumns problem.

After inserting a column, fetching data through QSqlTableModel was
off by one or more, since it passed the indexInQuery through to
QSQM.  Also, the headerData would sometimes return a blank string
for an inserted column, and sometimes the column number.

The autotests have been beefed up a little to check insertRows and
insertColumns play nicely.

Change-Id: I7399d4c4d94f958884b67ab9b39b5cf2485d8416
Task-number: QTBUG-12626
Reviewed-by: Charles Yin
(cherry picked from commit 9c61e9a40e774fe32b16c133a5cdd6b9d9d29d83)
src/sql/models/qsqlquerymodel.cpp
src/sql/models/qsqltablemodel.cpp
tests/auto/qsqldatabase/tst_databases.h
tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp
tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp