diff options
-rw-r--r-- | src/particles/qquickitemparticle.cpp | 4 | ||||
-rw-r--r-- | src/qmltest/quicktest.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultcontext.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquickpath.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp | 27 | ||||
-rw-r--r-- | tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp | 5 | ||||
-rw-r--r-- | tests/auto/quick/qquickgridview/tst_qquickgridview.cpp | 8 | ||||
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 8 | ||||
-rw-r--r-- | tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp | 8 | ||||
-rw-r--r-- | tests/auto/quick/shared/viewtestutil.cpp | 3 |
11 files changed, 45 insertions, 30 deletions
diff --git a/src/particles/qquickitemparticle.cpp b/src/particles/qquickitemparticle.cpp index c5c18a201c..e68ea54707 100644 --- a/src/particles/qquickitemparticle.cpp +++ b/src/particles/qquickitemparticle.cpp @@ -230,13 +230,13 @@ void QQuickItemParticle::reset() // delete all managed items which had their logical particles cleared // but leave it alone if the logical particle is maintained - QSet<QQuickItem*> lost = QSet<QQuickItem*>::fromList(m_managed); + QSet<QQuickItem*> lost = QSet<QQuickItem*>(m_managed.cbegin(), m_managed.cend()); for (auto groupId : groupIds()) { for (QQuickParticleData* d : qAsConst(m_system->groupData[groupId]->data)) { lost.remove(d->delegate); } } - m_deletables.append(lost.toList()); + m_deletables.append(lost.values()); //TODO: This doesn't yet handle calling detach on taken particles in the system reset case processDeletables(); } diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 6aff7af0e7..2b0205cdd4 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -559,7 +559,7 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch // Register the test object qmlRegisterSingletonType<QTestRootObject>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObject); - QSet<QString> commandLineTestFunctions = QTest::testFunctions.toSet(); + QSet<QString> commandLineTestFunctions(QTest::testFunctions.cbegin(), QTest::testFunctions.cend()); const bool filteringTestFunctions = !commandLineTestFunctions.isEmpty(); // Scan through all of the "tst_*.qml" files and run each of them @@ -601,7 +601,7 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch continue; } - const QSet<QString> availableTestSet = availableTestFunctions.toSet(); + const QSet<QString> availableTestSet(availableTestFunctions.cbegin(), availableTestFunctions.cend()); if (filteringTestFunctions && !availableTestSet.intersects(commandLineTestFunctions)) continue; commandLineTestFunctions.subtract(availableTestSet); diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index 70b74b8877..a5b2b04c93 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -160,7 +160,7 @@ void QSGDefaultContext::renderContextInitialized(QSGRenderContext *renderContext qCDebug(QSG_LOG_INFO, "GL_RENDERER: %s", (const char*)funcs->glGetString(GL_RENDERER)); qCDebug(QSG_LOG_INFO, "GL_VERSION: %s", (const char*)funcs->glGetString(GL_VERSION)); - QByteArrayList exts = openglRenderContext->openglContext()->extensions().toList(); + QByteArrayList exts = openglRenderContext->openglContext()->extensions().values(); std::sort(exts.begin(), exts.end()); qCDebug(QSG_LOG_INFO, "GL_EXTENSIONS: %s", exts.join(' ').constData()); qCDebug(QSG_LOG_INFO, "Max Texture Size: %d", openglRenderContext->maxTextureSize()); diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp index 94912778f8..a850f72053 100644 --- a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp +++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp @@ -183,7 +183,7 @@ void QSGDefaultDepthStencilBuffer::free() QSGDepthStencilBufferManager::~QSGDepthStencilBufferManager() { for (Hash::const_iterator it = m_buffers.constBegin(), cend = m_buffers.constEnd(); it != cend; ++it) { - QSGDepthStencilBuffer *buffer = it.value().data(); + QSGDepthStencilBuffer *buffer = it.value().toStrongRef().data(); buffer->free(); buffer->m_manager = nullptr; } diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index 60d725d650..16723b997e 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -570,7 +570,7 @@ void QQuickPath::gatherAttributes() attributes.insert(attribute->name()); } - d->_attributes = attributes.toList(); + d->_attributes = attributes.values(); } void QQuickPath::componentComplete() @@ -603,7 +603,7 @@ QStringList QQuickPath::attributes() const qobject_cast<QQuickPathAttribute *>(pathElement)) attrs.insert(attribute->name()); } - return attrs.toList(); + return attrs.values(); } return d->_attributes; } diff --git a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp index c215e9620d..23be541a72 100644 --- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp +++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp @@ -645,10 +645,21 @@ void tst_qmldiskcache::localAliases() } } +static QSet<QString> entrySet(const QDir &dir) +{ + const auto &list = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); + return QSet<QString>(list.cbegin(), list.cend()); +} + +static QSet<QString> entrySet(const QDir &dir, const QStringList &filters) +{ + const auto &list = dir.entryList(filters); + return QSet<QString>(list.cbegin(), list.cend()); +} + void tst_qmldiskcache::cacheResources() { - const QSet<QString> existingFiles = - m_qmlCacheDirectory.entryList(QDir::Files | QDir::NoDotAndDotDot).toSet(); + const QSet<QString> existingFiles = entrySet(m_qmlCacheDirectory); QQmlEngine engine; @@ -659,8 +670,7 @@ void tst_qmldiskcache::cacheResources() QCOMPARE(obj->property("value").toInt(), 20); } - const QSet<QString> entries = - m_qmlCacheDirectory.entryList(QDir::NoDotAndDotDot | QDir::Files).toSet().subtract(existingFiles); + const QSet<QString> entries = entrySet(m_qmlCacheDirectory).subtract(existingFiles); QCOMPARE(entries.count(), 1); QDateTime cacheFileTimeStamp; @@ -689,8 +699,7 @@ void tst_qmldiskcache::cacheResources() } { - const QSet<QString> entries = - m_qmlCacheDirectory.entryList(QDir::NoDotAndDotDot | QDir::Files).toSet().subtract(existingFiles); + const QSet<QString> entries = entrySet(m_qmlCacheDirectory).subtract(existingFiles); QCOMPARE(entries.count(), 1); QCOMPARE(QFileInfo(m_qmlCacheDirectory.absoluteFilePath(*entries.cbegin())).lastModified().toMSecsSinceEpoch(), @@ -914,8 +923,7 @@ void tst_qmldiskcache::cppRegisteredSingletonDependency() void tst_qmldiskcache::cacheModuleScripts() { - const QSet<QString> existingFiles = - m_qmlCacheDirectory.entryList(QDir::Files | QDir::NoDotAndDotDot).toSet(); + const QSet<QString> existingFiles = entrySet(m_qmlCacheDirectory); QQmlEngine engine; @@ -936,8 +944,7 @@ void tst_qmldiskcache::cacheModuleScripts() QVERIFY(!compilationUnit->backingFile.isNull()); } - const QSet<QString> entries = - m_qmlCacheDirectory.entryList(QStringList("*.mjsc")).toSet().subtract(existingFiles); + const QSet<QString> entries = entrySet(m_qmlCacheDirectory, QStringList("*.mjsc")); QCOMPARE(entries.count(), 1); diff --git a/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp b/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp index 5781a007b6..ca348eea03 100644 --- a/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp +++ b/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp @@ -120,7 +120,7 @@ void tst_PropertyRequirements::constantOrNotifyableFull() } static const QString messagePattern("\nProperty %1 neither CONSTANT nor NOTIFYable. Affected types:\n\t%2"); - QStringList occurrencesList = occurrences.toList(); + QStringList occurrencesList = occurrences.values(); occurrencesList.sort(); messages.append(messagePattern.arg(it.key(), occurrencesList.join("\n\t"))); @@ -158,7 +158,8 @@ void tst_PropertyRequirements::testAllQmlTypes(TestDepth testDepth, FailuresByPr testQmlType(testDepth, qmlType, failuresByProperty); } } - seenTypes.unite(QSet<QString>::fromList(QQmlMetaType::qmlTypeNames())); + const auto &typeNameList = QQmlMetaType::qmlTypeNames(); + seenTypes.unite(QSet<QString>(typeNameList.cbegin(), typeNameList.cend())); } } diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index b65b8770b1..46e3457d6e 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -6433,11 +6433,13 @@ QList<int> tst_QQuickGridView::toIntList(const QVariantList &list) void tst_QQuickGridView::matchIndexLists(const QVariantList &indexLists, const QList<int> &expectedIndexes) { + const QSet<int> expectedIndexSet(expectedIndexes.cbegin(), expectedIndexes.cend()); for (int i=0; i<indexLists.count(); i++) { - QSet<int> current = indexLists[i].value<QList<int> >().toSet(); - if (current != expectedIndexes.toSet()) + const auto ¤tList = indexLists[i].value<QList<int> >(); + const QSet<int> current(currentList.cbegin(), currentList.cend()); + if (current != expectedIndexSet) qDebug() << "Cannot match actual targets" << current << "with expected" << expectedIndexes; - QCOMPARE(current, expectedIndexes.toSet()); + QCOMPARE(current, expectedIndexSet); } } diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 894a5ee16e..7d5ad1b604 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -7265,11 +7265,13 @@ QList<int> tst_QQuickListView::toIntList(const QVariantList &list) void tst_QQuickListView::matchIndexLists(const QVariantList &indexLists, const QList<int> &expectedIndexes) { + const QSet<int> expectedIndexSet(expectedIndexes.cbegin(), expectedIndexes.cend()); for (int i=0; i<indexLists.count(); i++) { - QSet<int> current = indexLists[i].value<QList<int> >().toSet(); - if (current != expectedIndexes.toSet()) + const auto ¤tList = indexLists[i].value<QList<int> >(); + const QSet<int> current(currentList.cbegin(), currentList.cend()); + if (current != expectedIndexSet) qDebug() << "Cannot match actual targets" << current << "with expected" << expectedIndexes; - QCOMPARE(current, expectedIndexes.toSet()); + QCOMPARE(current, expectedIndexSet); } } diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp index 80be25d1b0..d3c0f345b9 100644 --- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp +++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp @@ -4029,11 +4029,13 @@ QQuickView *tst_qquickpositioners::createView(const QString &filename, bool wait void tst_qquickpositioners::matchIndexLists(const QVariantList &indexLists, const QList<int> &expectedIndexes) { + const QSet<int> expectedIndexSet(expectedIndexes.cbegin(), expectedIndexes.cend()); for (int i=0; i<indexLists.count(); i++) { - QSet<int> current = indexLists[i].value<QList<int> >().toSet(); - if (current != expectedIndexes.toSet()) + const auto ¤tList = indexLists[i].value<QList<int> >(); + const QSet<int> current(currentList.cbegin(), currentList.cend()); + if (current != expectedIndexSet) qDebug() << "Cannot match actual targets" << current << "with expected" << expectedIndexes; - QCOMPARE(current, expectedIndexes.toSet()); + QCOMPARE(current, expectedIndexSet); } } diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp index 5631ffe047..1680e850f7 100644 --- a/tests/auto/quick/shared/viewtestutil.cpp +++ b/tests/auto/quick/shared/viewtestutil.cpp @@ -328,7 +328,8 @@ QQuickViewTestUtil::ListRange QQuickViewTestUtil::ListRange::operator+(const Lis bool QQuickViewTestUtil::ListRange::operator==(const ListRange &other) const { - return indexes.toSet() == other.indexes.toSet(); + return QSet<int>(indexes.cbegin(), indexes.cend()) + == QSet<int>(other.indexes.cbegin(), other.indexes.cend()); } bool QQuickViewTestUtil::ListRange::operator!=(const ListRange &other) const |