summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2011-11-23 15:03:04 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-25 01:12:14 +0100
commit66b659c8a4a429b483b66fd1a1d1429a2c0d3b4a (patch)
treec654cac67ca5d6cc2cbd2d41d03b83f5011dc0c3 /tests/auto/corelib/kernel
parent583c55b243d9894d93d32fbe15bece2a9beb1d10 (diff)
Add support for QueuedConnection when connecting using the new syntax
QMetaCallEvent now can handle a pointer to QSlotObjectBase Change-Id: I94da1e68ce9bb1fd96a9ae013a389552eb625faa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index a00171571b..91ad3928aa 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -2812,6 +2812,10 @@ void tst_QObject::blockingQueuedConnection()
QVERIFY(QMetaObject::invokeMethod(&receiver, "slot1", Qt::BlockingQueuedConnection));
QVERIFY(receiver.called(1));
+ connect(&sender, &SenderObject::signal2, &receiver, &ReceiverObject::slot2, Qt::BlockingQueuedConnection);
+ sender.emitSignal2();
+ QVERIFY(receiver.called(2));
+
thread.quit();
QVERIFY(thread.wait());
}
@@ -4173,6 +4177,29 @@ void tst_QObject::customTypesPointer()
QCOMPARE(checker.received.value(), 0);
checker.doEmit(t1);
QCOMPARE(checker.received.value(), t1.value());
+ checker.received = t0;
+
+
+ checker.disconnect();
+
+ int idx = qRegisterMetaType<CustomType>("CustomType");
+ QCOMPARE(QMetaType::type("CustomType"), idx);
+
+ connect(&checker, &QCustomTypeChecker::signal1, &checker, &QCustomTypeChecker::slot1,
+ Qt::QueuedConnection);
+ QCOMPARE(instanceCount, 4);
+ checker.doEmit(t2);
+ QCOMPARE(instanceCount, 5);
+ QCOMPARE(checker.received.value(), t0.value());
+
+ QCoreApplication::processEvents();
+ QCOMPARE(checker.received.value(), t2.value());
+ QCOMPARE(instanceCount, 4);
+
+ QVERIFY(QMetaType::isRegistered(idx));
+ QCOMPARE(qRegisterMetaType<CustomType>("CustomType"), idx);
+ QCOMPARE(QMetaType::type("CustomType"), idx);
+ QVERIFY(QMetaType::isRegistered(idx));
}
QCOMPARE(instanceCount, 3);
}