'PyQt 6: Are there any classes with signals that emit when the device connects/disconnects to/from the internet?

I'm adding a download function to an application that I'm creating. When the user's device's internet connection is lost during a download, I want the download to continue on once the connection is re-established; provided that the application is still running, of course. How can I do this? It appears that there used to be a QtNetwork.QNetworkSession().stateChanged signal that could be used to do this but it's deprecated in Qt6 and I can't seem to find an alternative to it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source