Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.3.1
-
None
-
openSUSE Linux 13.1
-
Ia546fc8f36e1ea0dd0645bdd820aea47f43677ac
Description
When invoking QObject::disconnect() with a member function pointer for a subclass of the class the signal is defined in, the signal isn't found. While QObject::connectImpl() iterates through the meta objects of superclasses to find the signal, QObject::disconnectImpl() checks only the given meta object itself. Example:
#include <QTcpSocket> int main(int , char **) { QTcpSocket socket; void (QTcpSocket::* socketErrorSignal)(QAbstractSocket::SocketError) = &QTcpSocket::error; QObject::connect(&socket, socketErrorSignal, &socket, &QObject::deleteLater); // ^ succeeds QObject::disconnect(&socket, socketErrorSignal, &socket, &QObject::deleteLater); // ^ fails return 0; }
Attachments
For Gerrit Dashboard: QTBUG-40638 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
91749,2 | Fix disconnect()ing from signals declared in a base class | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |
91831,3 | Fix disconnect()ing from signals declared in a base class | 5.3 | qt/qtbase | Status: MERGED | +2 | 0 |