diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2011-12-15 06:57:17 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-29 12:40:51 +0100 |
commit | 889092504e0f1e67dc9c7f27817fb809d7170132 (patch) | |
tree | 0ec991259231f9c3062595d9f99bf4dd813a1e49 /tests/auto | |
parent | 7c0153faf7664bf0f7e64b578f3d196aae02c328 (diff) |
Call connectNotify when connecting with function pointer
Some objects expect connectNotify to be called in order the signal to be
emitted.
Change-Id: Id0460d9c2aef8f9c3618a2b62b2119a790e06f30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index c1471e4f21..9bd54bd035 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -75,6 +75,7 @@ private slots: void findChildren(); void connectDisconnectNotify_data(); void connectDisconnectNotify(); + void connectNotifyPtr(); void emitInDefinedOrder(); void customTypes(); void streamCustomTypes(); @@ -849,6 +850,19 @@ void tst_QObject::connectDisconnectNotify() delete r; } +void tst_QObject::connectNotifyPtr() +{ + NotifyObject *s = new NotifyObject; + NotifyObject *r = new NotifyObject; + + connect( (SenderObject*)s, &SenderObject::signal1, (ReceiverObject*)r, &ReceiverObject::slot1 ); + QCOMPARE( s->org_signal, s->nw_signal ); + QCOMPARE( s->org_signal.toLatin1(), QMetaObject::normalizedSignature(SIGNAL(signal1()))); + + delete s; + delete r; +} + class SequenceObject : public ReceiverObject { Q_OBJECT |