summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/tst_moc.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-03-11 18:50:52 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2017-03-13 10:28:42 +0000
commit8c0194f76355c5a0341d276d09c2e49462082901 (patch)
treeb85476af6637ecbaf213f9024d67c5d2bb993e75 /tests/auto/tools/moc/tst_moc.cpp
parentd8a123841c98f5af1707ef818a848268d793eab3 (diff)
moc: put the QPrivateSignal argument in the arg array
Even if it is normaly not used, templated code might still try to access it Task-number: QTBUG-59414 Change-Id: I9f7aadd714843059c8f89cdac48c60a3e2ca7294 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/tools/moc/tst_moc.cpp')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 2d7ec2f0b5..7c05b388dc 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2837,6 +2837,21 @@ void tst_Moc::privateSignalConnection()
// We can't use function pointer connections to private signals which are overloaded because we would have to cast in this case to:
// static_cast<void (ClassWithPrivateSignals::*)(int, ClassWithPrivateSignals::QPrivateSignal)>(&ClassWithPrivateSignals::overloadedMaybePrivate)
// Which doesn't work as ClassWithPrivateSignals::QPrivateSignal is private.
+
+ // Connecting from one private signal to another
+ {
+ ClassWithPrivateSignals classWithPrivateSignals1;
+ ClassWithPrivateSignals classWithPrivateSignals2;
+ SignalConnectionTester tester;
+ QObject::connect(&classWithPrivateSignals1, &ClassWithPrivateSignals::privateSignal1,
+ &classWithPrivateSignals2, &ClassWithPrivateSignals::privateSignal1);
+ QObject::connect(&classWithPrivateSignals2, &ClassWithPrivateSignals::privateSignal1,
+ &tester, &SignalConnectionTester::testSlot);
+
+ QVERIFY(!tester.testPassed);
+ classWithPrivateSignals1.emitPrivateSignals();
+ QVERIFY(tester.testPassed);
+ }
}
void tst_Moc::finalClasses_data()