diff options
Diffstat (limited to 'tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp')
-rw-r--r-- | tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp index 67c44684a4..0269756225 100644 --- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp +++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + #include <qtest.h> #include <QtQml/qqmlengine.h> #include <QtQml/qqmlcomponent.h> @@ -164,9 +165,9 @@ void tst_qqmlsqldatabase::testQml_cleanopen() engine->collectGarbage(); - foreach (QString dbname, QSqlDatabase::connectionNames()) { + const QStringList connectionNames = QSqlDatabase::connectionNames(); + for (const QString &dbname : connectionNames) QSqlDatabase::removeDatabase(dbname); - } } void tst_qqmlsqldatabase::totalDatabases() |