Advertisement
Guest User

connectionutility.h

a guest
Jun 30th, 2011
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #ifndef CONECTIONUTILITY_H
  2. #define CONECTIONUTILITY_H
  3.  
  4. #include <QDebug>
  5.  
  6. #include <QNetworkConfigurationManager>
  7. #include <QNetworkConfiguration>
  8.  
  9. class ConnectionUtility: public QObject
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. ConnectionUtility(QObject *parent = 0) :
  15. QObject(parent){
  16.  
  17. }
  18.  
  19. public slots:
  20. void checkConnectionStatus(){
  21. QNetworkConfigurationManager manager;
  22. manager.updateConfigurations();
  23. }
  24.  
  25. void connectionListUpdated(){
  26. QNetworkConfigurationManager manager;
  27. QList<QNetworkConfiguration> list = manager.allConfigurations(QNetworkConfiguration::Discovered);
  28.  
  29. for (int i = 0 ; i < list.count() ; ++i)
  30. {
  31. qDebug() << "Name: " << list[i].name() << "Type: " << list[i].bearerTypeName() << "State: " << list[i].state() << "Identifier: " << list[i].identifier();
  32. }
  33. }
  34. };
  35.  
  36. #endif // CONECTIONUTILITY_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement