Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.4, 6.3, 6.4
-
None
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
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-104001 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
472390,1 | QMetaMethod: disallow invoking signals with QPrivateSignal params | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |