diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-08-09 14:45:49 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-08-09 14:11:16 +0000 |
commit | 199c9ed5b377c847890e0719369bfc879fd351ed (patch) | |
tree | df6a9e57b91465a51c7417386cef13d27486fdfe /tests | |
parent | ced81dfa5e7d4d4c4958fae7521e32e5a18c8678 (diff) |
Make generated signals public
Access control for signals cannot be enforced anyway and QML has a bug
that makes the type compiler crash if anything tries to connect to a
private signal. Besides, they should be accessible from other code.
Change-Id: I9af527f012e3ea8538107b74ce20157f01fef6ae
Task-number: QTBUG-51817
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/compiled/tst_compiled.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/compiled/tst_compiled.cpp b/tests/auto/compiled/tst_compiled.cpp index 0be848c..47463af 100644 --- a/tests/auto/compiled/tst_compiled.cpp +++ b/tests/auto/compiled/tst_compiled.cpp @@ -56,6 +56,7 @@ private Q_SLOTS: void myConnection(); void topMachine(); void topMachineDynamic(); + void publicSignals(); }; void tst_Compiled::stateNames() @@ -268,6 +269,17 @@ void tst_Compiled::topMachineDynamic() QTRY_COMPARE(runningSubMachinesCount, 0); } +void tst_Compiled::publicSignals() +{ + const QMetaObject *connectionMeta = &Connection::staticMetaObject; + int index = connectionMeta->indexOfSignal("aChanged(bool)"); + QVERIFY(index >= 0); + + QMetaMethod aChanged = connectionMeta->method(index); + QVERIFY(aChanged.isValid()); + QCOMPARE(aChanged.access(), QMetaMethod::Public); +} + QTEST_MAIN(tst_Compiled) #include "tst_compiled.moc" |