Details
-
Type:
Task
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 6.2.4, 6.3, 6.4
-
Fix Version/s: None
-
Component/s: Build tools: moc, Core: Object Model
-
Labels:None
-
Platform/s:
Description
Adding QPrivateSignal as an argument to the signal is meant to make it impossible to call from any other class than the owning class.
However, moc generates, in qt_static_metacall, the call for InvokeMetaMethod with the QPrivateSignal argument. For example:
case 1: _t->pendingConnectionAvailable(QPrivateSignal()); break;
This means it is possible to still emit the signal by using the string-based lookup. Like so:
QMetaObject::invokeMethod(this, "pendingConnectionAvailable");
The code snippet above was added to the patch below inside the DerivedServer::incomingConnection function, where 'pendingConnectionAvailable' is a private signal on the parent, QTcpServer.
See following patch for where the code is generated from/added to:
https://codereview.qt-project.org/c/qt/qtbase/+/413535