From 6f0f9f69288925ef423c542ef5eb7302a5431867 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 22 Nov 2011 14:45:35 +0100 Subject: Remove QMetaObject guards and deprecate QPointer. QWeakPointer is superior and preferred. Remove QMetaObject::addGuard(), QMetaObject::changeGuard(), QMetaObject::removeGuard(), and QObjectPrivate::clearGuards(). Implement QPointer using QWeakPointer instead. This changes the behavior of QPointer in 2 ways: - During destruction of a QWidget. Previously, the destructor of QWidget would reset all QPointers so that they would return zero when destroying children. Update tst_QPointer to account for this change. - When constructing a QSharedPointer to take ownership of an object after a QPointer is already tracking the object. Previously, the shared pointer construction would not be affected by the QPointer, but now that QPointer is implemented using QWeakPoiner, constructing the QSharedPointer will cause an abort(). Fix tst_QSharedPointer by removing the use of QPointer in the objectCast() test. These behavior changes are documented in the QPointer class documentation and in the changes file. Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747 Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart --- tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp') diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 7eb1bd2dee..649842f946 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -767,7 +767,6 @@ void tst_QSharedPointer::objectCast() { OtherObject *data = new OtherObject; - QPointer qptr = data; QSharedPointer ptr = QSharedPointer(data); QWeakPointer weakptr = ptr; @@ -788,7 +787,6 @@ void tst_QSharedPointer::objectCast() // drop the reference: ptr.clear(); QVERIFY(ptr.isNull()); - QVERIFY(qptr.isNull()); QVERIFY(weakptr.toStrongRef().isNull()); // verify that the object casts fail without crash -- cgit v1.2.3