diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-18 09:58:34 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-19 07:24:13 +0000 |
commit | efd8e6922c59f6f9240b01e4e620fb464d11fc78 (patch) | |
tree | 03ff429d2be024f3ba332ba52463c65ff04ce65a /tests/auto | |
parent | 970f44bf484fba6ee8b6976768996e0b3dc8b2df (diff) |
QSqlQueryModel::clear(): Call begin/endResetModel().
Call begin/endResetModel() in QSqlQueryModel and all
derived classes.
Task-number: QTBUG-49404
Change-Id: I11492d6386efb4c945c246a6379aaa6ca4502a25
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp index ae2f8dde5f..52baa0070b 100644 --- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp +++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp @@ -593,7 +593,7 @@ public: connect(this, SIGNAL(modelReset()), this, SLOT(modelResetSlot())); } - void testme() + void testNested() { // Only the outermost beginResetModel/endResetModel should // emit signals. @@ -618,6 +618,14 @@ public: QCOMPARE(gotReset, true); } + void testClear() // QTBUG-49404: Basic test whether clear() emits signals. + { + gotAboutToBeReset = gotReset = false; + clear(); + QVERIFY(gotAboutToBeReset); + QVERIFY(gotReset); + } + private slots: void modelAboutToBeResetSlot() { gotAboutToBeReset = true; } void modelResetSlot() { gotReset = true; } @@ -634,7 +642,8 @@ void tst_QSqlQueryModel::nestedResets() CHECK_DATABASE(db); NestedResetsTest t; - t.testme(); + t.testClear(); + t.testNested(); } // For task 180617 |