tests/auto/qobject/tst_qobject.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
child 30 5dc02b23752f
--- a/tests/auto/qobject/tst_qobject.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/tests/auto/qobject/tst_qobject.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -2647,6 +2647,16 @@
     QVERIFY(spy.eventList().isEmpty());
 }
 
+class EmitThread : public QThread
+{   Q_OBJECT
+public:
+    void run(void) {
+        emit work();
+    }
+signals:
+    void work();
+};
+
 class DeleteObject : public QObject
 {
     Q_OBJECT
@@ -2712,6 +2722,16 @@
 
         QVERIFY(thread.wait(10000));
     }
+
+    {
+        EmitThread sender;
+        DeleteObject *receiver = new DeleteObject();
+        connect(&sender, SIGNAL(work()), receiver, SLOT(deleteSelf()), Qt::DirectConnection);
+        QPointer<DeleteObject> p = receiver;
+        sender.start();
+        QVERIFY(sender.wait(10000));
+        QVERIFY(p.isNull());
+    }
 }
 
 class DisconnectObject : public QObject