Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the system network status in Qt?

How to get the system network status in Qt like we get event hits in .NET so that each and every time when we connect network get a signal of a status of the network connection?

Is there any function that have same functionality as I mentioned above?

Using ping and other methods of network configuration takes a small amount of time.
But I need to display it as fast as I could other than using a specific port to listen to the socket and display its error.

Can any one help me out of it?

like image 853
Dev Avatar asked Oct 07 '14 08:10

Dev


1 Answers

I found a good example of getting network information using QT: http://developer.nokia.com/community/wiki/Get_Network_information_using_Qt

For instance, you can get the signal strength from the public member, networkSignalStrength, of QSystemNetworkInfo. And, if you take a look at QSystemNetworkInfo class reference, you can find signals such as networkSignalStrengthChanged so that you can handle something when network signal strength gets changed.

Hope this helps!

like image 195
sam Avatar answered Nov 15 '22 23:11

sam