Obsolete Members for QSocketNotifier

以下成员源于类 QSocketNotifier 被弃用。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

信号

(弃用) void activated (int socket ) [see note below]

注意: 这是私有信号。它可以用于信号连接,但不能由用户发射。

成员函数文档编制

[private signal] 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 参数。

注意: 这是私有信号。它可以用于信号连接,但不能由用户发射。

注意: 信号 activated 在此类中被重载。通过使用函数指针句法连接到此信号,Qt 提供用于获得如此范例展示的函数指针的方便帮助程序:

connect(socketNotifier, QOverload<int>::of(&QSocketNotifier::activated),
    [=](int socket){ /* ... */ });
					

另请参阅 type () 和 socket ().