Obsolete Members for QSocketNotifier

以下成員源於類 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 */ });
					

更多範例和方式,見 連接到重載信號 .

另請參閱 type () 和 socket ().