diff options
author | Eckhart Koppen <eckhart.koppen@nokia.com> | 2011-03-08 07:12:58 (GMT) |
---|---|---|
committer | Eckhart Koppen <eckhart.koppen@nokia.com> | 2011-03-08 07:12:58 (GMT) |
commit | cddc9fd3913fa511fbe5feac4c6ff61464bc78fa (patch) | |
tree | 9ae83863ed3b805d3bb0639d1268906564f9801a /tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp | |
parent | f96b9e139dd67d2be992e86af9fb41e4cdfcb6cf (diff) | |
parent | 0766bf2fa4a89e629bbdad185e4919fd49c033a1 (diff) | |
download | Qt-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.cpp | 21 |
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() |