summaryrefslogtreecommitdiffstats
path: root/src/net/pvsNetworkInterfaceListModel.h
diff options
context:
space:
mode:
authorSebastien Braun2010-10-04 00:11:13 +0200
committerSebastien Braun2010-10-05 22:12:26 +0200
commitb003c313227e330c3ba92714655a4fc0f408f9fa (patch)
tree6c671fb9ca811dab632418f38bf5334d562a7d29 /src/net/pvsNetworkInterfaceListModel.h
parentImplement Network-wide Configuration Interface for Multicast File Transfer (diff)
downloadpvs-b003c313227e330c3ba92714655a4fc0f408f9fa.tar.gz
pvs-b003c313227e330c3ba92714655a4fc0f408f9fa.tar.xz
pvs-b003c313227e330c3ba92714655a4fc0f408f9fa.zip
Remove system-dependent interface enumeration code and introduce proper
Model-View portable code in its stead.
Diffstat (limited to 'src/net/pvsNetworkInterfaceListModel.h')
-rw-r--r--src/net/pvsNetworkInterfaceListModel.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/net/pvsNetworkInterfaceListModel.h b/src/net/pvsNetworkInterfaceListModel.h
new file mode 100644
index 0000000..3a9b95d
--- /dev/null
+++ b/src/net/pvsNetworkInterfaceListModel.h
@@ -0,0 +1,35 @@
+/*
+ * pvsNetworkInterfaceListModel.h
+ *
+ * Created on: 04.08.2010
+ * Author: brs
+ */
+
+#ifndef PVSNETWORKINTERFACELISTMODEL_H_
+#define PVSNETWORKINTERFACELISTMODEL_H_
+
+#include <QAbstractListModel>
+#include <QList>
+#include <QNetworkInterface>
+#include <QVariant>
+
+class PVSNetworkInterfaceListModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ PVSNetworkInterfaceListModel(QObject* parent = 0);
+ virtual ~PVSNetworkInterfaceListModel();
+
+ QVariant data(QModelIndex const& index, int role = Qt::DisplayRole) const;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
+ int rowCount(QModelIndex const&) const;
+
+private:
+ QList<QNetworkInterface> _interfaces;
+
+public slots:
+ void reloadInterfaceList();
+};
+
+#endif /* PVSNETWORKINTERFACELISTMODEL_H_ */