summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
diff options
context:
space:
mode:
authorEckhart Koppen <eckhart.koppen@nokia.com>2011-03-08 07:12:58 (GMT)
committerEckhart Koppen <eckhart.koppen@nokia.com>2011-03-08 07:12:58 (GMT)
commitcddc9fd3913fa511fbe5feac4c6ff61464bc78fa (patch)
tree9ae83863ed3b805d3bb0639d1268906564f9801a /tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
parentf96b9e139dd67d2be992e86af9fb41e4cdfcb6cf (diff)
parent0766bf2fa4a89e629bbdad185e4919fd49c033a1 (diff)
downloadQt-cddc9fd3913fa511fbe5feac4c6ff61464bc78fa.zip
Qt-cddc9fd3913fa511fbe5feac4c6ff61464bc78fa.tar.gz
Qt-cddc9fd3913fa511fbe5feac4c6ff61464bc78fa.tar.bz2
Merge remote branch 'qt-master/master'
Diffstat (limited to 'tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp')
-rw-r--r--tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
index f7d2180..bf68375 100644
--- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -773,6 +773,27 @@ void tst_QSqlTableModel::removeInsertedRow()
QCOMPARE(model.data(model.index(0, 1)).toString(), QString("harry"));
QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond"));
QCOMPARE(model.data(model.index(2, 1)).toString(), QString("vohi"));
+
+ // Now insert a row with a null, and check that removing it also works (QTBUG-15979 etc)
+ model.insertRow(1);
+ model.setData(model.index(1,0), 55);
+ model.setData(model.index(1,1), QString("null columns"));
+ model.setData(model.index(1,2), QVariant());
+
+ model.submitAll();
+
+ QCOMPARE(model.rowCount(), 4);
+ QCOMPARE(model.data(model.index(3, 0)).toInt(), 55);
+ QCOMPARE(model.data(model.index(3, 1)).toString(), QString("null columns"));
+ QCOMPARE(model.data(model.index(3, 2)).isNull(), true);
+
+ QVERIFY(model.removeRow(3));
+ model.submitAll();
+ QCOMPARE(model.rowCount(), 3);
+
+ QCOMPARE(model.data(model.index(0, 1)).toString(), QString("harry"));
+ QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond"));
+ QCOMPARE(model.data(model.index(2, 1)).toString(), QString("vohi"));
}
void tst_QSqlTableModel::removeInsertedRows()