Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CONECTIONUTILITY_H
- #define CONECTIONUTILITY_H
- #include <QDebug>
- #include <QNetworkConfigurationManager>
- #include <QNetworkConfiguration>
- class ConnectionUtility: public QObject
- {
- Q_OBJECT
- public:
- ConnectionUtility(QObject *parent = 0) :
- QObject(parent){
- }
- public slots:
- void checkConnectionStatus(){
- QNetworkConfigurationManager manager;
- manager.updateConfigurations();
- }
- void connectionListUpdated(){
- QNetworkConfigurationManager manager;
- QList<QNetworkConfiguration> list = manager.allConfigurations(QNetworkConfiguration::Discovered);
- for (int i = 0 ; i < list.count() ; ++i)
- {
- qDebug() << "Name: " << list[i].name() << "Type: " << list[i].bearerTypeName() << "State: " << list[i].state() << "Identifier: " << list[i].identifier();
- }
- }
- };
- #endif // CONECTIONUTILITY_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement