Obsolete Members for QSocketNotifier
类QSocketNotifier 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。
信号
(deprecated) void | activated(int socket) | [see note below] |
注意: 这是一个私有信号。它可以在信号连接中使用,但不能由用户发出。
成员函数文档
[private signal, deprecated]
void QSocketNotifier::activated(int socket)
该函数已被弃用。我们强烈建议不要在新代码中使用它。
为避免描述符被意外截断,请使用该函数的 QSocketDescriptor 重载。如果需要与早于 5.15 的版本兼容,则需要将槽改为接受 qintptr(如果当前接受的是 int),然后使用基于函数的连接进行连接。
每当启用套接字通知器,并发生与type 对应的套接字事件时,就会发出该信号。
套接字标识符通过socket 参数传递。
注意: 这是一个私有信号。可以在信号连接中使用,但用户不能发出。
注:该类重载了信号激活。要使用函数指针语法连接该信号,Qt 提供了一个方便的辅助工具来获取函数指针,如本例所示:
connect(socketNotifier, QOverload<int>::of(&QSocketNotifier::activated), [=](int 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.