Obsolete Members for QSocketNotifier

以下成員源於類 QSocketNotifier 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

信號

(obsolete) void activated (int socket ) [見下文注意事項]

注意: 這是私有信號。它可以用於信號連接,但不能由用戶發射。

成員函數文檔編製

[signal] void QSocketNotifier:: activated ( int socket )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

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