path: root/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
diff options
authorThiago Macieira <>2014-03-06 13:01:20 -0800
committerThe Qt Project <>2014-04-24 10:49:10 +0200
commite57b521d950575a96d54e6944ab153a9505e51f7 (patch)
treef25c7e1dd2bd1bd2d54e6ffeae46617c4033fc81 /tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
parentcafa3848e2315d851a338c9821fb4cb47db511be (diff)
Deprecate setSharable in Qt containers
The ability to set a container to be unsharable has very little use and it costs us an extra conditional for every refcount up and possibly down. This change is a no-op for current Qt 5. It shuffles a few things around just so Qt can compile if you define QT_NO_UNSHARABLE_CONTAINERS. That is done to ease the fixing of the code in Qt 6 and to make my life easier: I'll keep that defined in my local Qt build so I can catch any misuses of this deprecated API. The newly deprecated methods are not marked QT_DEPRECATED because the bootstrapped tools wouldn't build -- they're built with QT_NO_DEPRECATED defined, which causes build errors. [ChangeLog][QtCore] The setSharable() and isSharable() functions in Qt containers has been deprecated and will be removed in Qt 6. New applications should not use this feature, while old applications that may be using this (undocumented) feature should port away from it. Discussed-on: Change-Id: I789771743dcaed6a43eccd99382f8b3ffa61e479 Reviewed-by: Oswald Buddenhagen <> Reviewed-by: Lars Knoll <>
Diffstat (limited to 'tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp')
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
index 49b32d5534..9e47e9c6d6 100644
--- a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
+++ b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
@@ -1018,12 +1018,14 @@ void tst_QLinkedList::initializeList() const
template<typename T>
void tst_QLinkedList::constSharedNull() const
+ QLinkedList<T> list2;
QLinkedList<T> list1;
- QLinkedList<T> list2;
@@ -1049,6 +1051,7 @@ void tst_QLinkedList::constSharedNullComplex() const
void tst_QLinkedList::setSharableInt() const
QLinkedList<int> orglist;
orglist << 0 << 1 << 2 << 3 << 4 << 5;
int size = 6;
@@ -1094,6 +1097,7 @@ void tst_QLinkedList::setSharableInt() const
QCOMPARE(list.size(), size);