From cc7239da8d1ab95e68e12a64df3ca3051419cb34 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 10 Feb 2013 10:57:43 +0100 Subject: Make it possible to use QPointer This is possible with QWeakPointer, so allow it for migrating code too. In the process, replace the QPointerBase with a member variable for simplicity. The functionality of the QPointerBase is replaced by a TypeSelector template. Change-Id: I3b4c77bdeda2b863cc33e84a3da8a25bae928c8c Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart --- tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto/corelib/kernel/qpointer') diff --git a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp index 7c6549364f..609b4b7dce 100644 --- a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp +++ b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp @@ -65,6 +65,7 @@ private slots: void threadSafety(); void qvariantCast(); + void constPointer(); }; void tst_QPointer::constructors() @@ -384,6 +385,12 @@ void tst_QPointer::qvariantCast() // QPointer sop = qPointerFromVariant(v); } +void tst_QPointer::constPointer() +{ + // Compile-time test that QPointer works. + QPointer fp = new QFile; + delete fp.data(); +} QTEST_MAIN(tst_QPointer) -- cgit v1.2.3