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; }