Obsolete Members for QSocketNotifier

The following members of class QSocketNotifier are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

Signals

(deprecated) void activated(int socket)[see note below]

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

Member Function Documentation

[private signal, deprecated] void QSocketNotifier::activated(int socket)

This function is deprecated. We strongly advise against using it in new code.

To avoid unintended truncation of the descriptor, use the QSocketDescriptor overload of this function. If you need compatibility with versions older than 5.15 you need to change the slot to accept qintptr if it currently accepts an int, and then connect using Functor-Based Connection.

This signal is emitted whenever the socket notifier is enabled and a socket event corresponding to its type occurs.

The socket identifier is passed in the socket parameter.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

Note: This signal is overloaded. To connect to this signal:

// Connect using qOverload:
connect(socketNotifier, qOverload(&QSocketNotifier::activated),
        receiver, &ReceiverClass::slot);

// Or using a lambda:
connect(socketNotifier, qOverload(&QSocketNotifier::activated),
        this, [](int socket) { /* handle activated */ });
For more examples and approaches, see connecting to overloaded signals.

See also type() and socket().

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.