以下成员源于类 QSocketNotifier 被弃用。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。
(弃用)
void
|
activated (int socket ) | [见下文注意事项] |
注意: 这是私有信号。它可以用于信号连接,但不能由用户发射。
[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.
此信号被发射每当套接字通知程序被启用时,且套接字事件对应 type 出现。
套接字标识符被传入 socket 参数。
注意: 这是私有信号。它可以用于信号连接,但不能由用户发射。
注意: 此信号被重载。要连接到此信号:
// 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 */ });
更多范例和方式,见 连接到重载信号 .