aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-27 15:04:25 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-29 23:47:31 +0200
commit0f035c0ad79ca41a1473b64a4c0077e7085d3700 (patch)
tree9295f556711a6230c812e1c8f5feee2782d6b3a7
parent9d61684d70c8691d81536b7b519388586e2cbbb8 (diff)
Fix deprecation warnings in 5.14
Libraries: scenegraph/util/qsgdepthstencilbuffer.cpp:186:57: warning: 'T* QWeakPointer<T>::data() const [with T = QSGDepthStencilBuffer]' is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] scenegraph/qsgdefaultcontext.cpp:163:89: warning: 'QList<T> QSet<T>::toList() const [with T = QByteArray]' is deprecated: Use values() instead. [-Wdeprecated-declarations] util/qquickpath.cpp:573:40: warning: 'QList<T> QSet<T>::toList() const [with T = QString]' is deprecated: Use values() instead. [-Wdeprecated-declarations] util/qquickpath.cpp:606:29: warning: 'QList<T> QSet<T>::toList() const [with T = QString]' is deprecated: Use values() instead. [-Wdeprecated-declarations] quicktest.cpp:562:73: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] quicktest.cpp:604:77: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] qquickitemparticle.cpp:233:49: warning: 'static QSet<T> QSet<T>::fromList(const QList<T>&) [with T = QQuickItem*]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] qquickitemparticle.cpp:239:37: warning: 'QList<T> QSet<T>::toList() const [with T = QQuickItem*]' is deprecated: Use values() instead. [-Wdeprecated-declarations] Tests: tst_propertyrequirements.cpp:123:58: warning: 'QList<T> QSet<T>::toList() const [with T = QString]' is deprecated: Use values() instead. [-Wdeprecated-declarations] tst_propertyrequirements.cpp:161:40: warning: 'static QSet<T> QSet<T>::fromList(const QList<T>&) [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_propertyrequirements.cpp:161:77: warning: 'static QSet<T> QSet<T>::fromList(const QList<T>&) [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] /data1/frkleint/qt-dev/qtbase/include/QtCore/../../src/corelib/tools/qset.h:400:23: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] ../shared/viewtestutil.cpp:331:26: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] ... tst_qmldiskcache.cpp:651:81: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qmldiskcache.cpp:663:81: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qmldiskcache.cpp:693:85: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qmldiskcache.cpp:918:81: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qmldiskcache.cpp:940:69: warning: 'QSet<T> QList<T>::toSet() const [with T = QString]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquickgridview.cpp:6437:70: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquickgridview.cpp:6438:46: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquickgridview.cpp:6440:66: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquicktableview.cpp:53:20: warning: 'kTableViewPropName' defined but not used [-Wunused-variable] tst_qquicklistview.cpp:7269:70: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquicklistview.cpp:7270:46: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquicklistview.cpp:7272:66: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquickpositioners.cpp:4033:70: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquickpositioners.cpp:4034:46: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] tst_qquickpositioners.cpp:4036:66: warning: 'QSet<T> QList<T>::toSet() const [with T = int]' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations] Change-Id: I9a177f83f07ae5162f7cc231a8c164ba32ffa5bc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/particles/qquickitemparticle.cpp4
-rw-r--r--src/qmltest/quicktest.cpp4
-rw-r--r--src/quick/scenegraph/qsgdefaultcontext.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp2
-rw-r--r--src/quick/util/qquickpath.cpp4
-rw-r--r--tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp27
-rw-r--r--tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp5
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp8
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp8
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp8
-rw-r--r--tests/auto/quick/shared/viewtestutil.cpp3
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 &currentList = 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 &currentList = 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 &currentList = 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