NetworkModel.h 695 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef NETWORKMODEL_H
  2. #define NETWORKMODEL_H
  3. #include <QAbstractListModel>
  4. #include <QNetworkConfiguration>
  5. class QNetworkConfigurationManager;
  6. class NetworkModel : public QAbstractListModel
  7. {
  8. Q_OBJECT
  9. enum {
  10. RoleName = Qt::UserRole + 1,
  11. RoleDescription
  12. };
  13. public:
  14. explicit NetworkModel(QObject *parent = 0);
  15. ~NetworkModel();
  16. int rowCount(const QModelIndex &parent) const;
  17. QVariant data(const QModelIndex &index, int role) const;
  18. QNetworkConfiguration configurationForRow(int row);
  19. public slots:
  20. void scan();
  21. signals:
  22. private:
  23. QNetworkConfigurationManager* m_manager;
  24. QList<QNetworkConfiguration> m_configurations;
  25. };
  26. #endif // NETWORKMODEL_H