- Qt 6.10
- Qt Core
- C++ Classes
- QSocketNotifier
- Qt 6.10.2 Reference Documentation

# 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().