Index: sources/device/DeviceView.h =================================================================== diff -u -r0932b2beee9cc169291cbf69161f902f805237b1 -r574c7c5fb48b1fcb72337f5fb4c0119a20288815 --- sources/device/DeviceView.h (.../DeviceView.h) (revision 0932b2beee9cc169291cbf69161f902f805237b1) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision 574c7c5fb48b1fcb72337f5fb4c0119a20288815) @@ -16,6 +16,7 @@ // Qt #include +#include // Project #include "main.h" // Doxygen : do not remove @@ -33,7 +34,8 @@ * \details The device view to interact with the UI. * */ -class VDevice : public QObject { +class VDevice : public QAbstractListModel { + Q_OBJECT TRIGGER ( bool , response , true) @@ -60,15 +62,47 @@ ATTRIBUTE ( QString , decommission , "", Decommission ) PROPERTY ( bool , decommissionEnabled , true ) + ATTRIBUTE ( QStringList , wifiList , {}, WifiList ) READONLY ( bool , wifiListEnabled , true ) + VIEW_DEC_CLASS_EX(VDevice, QAbstractListModel) + enum DataRole { + eRole_DataRole_Start = Qt::UserRole , + eRole_WifiMacAddress , + eRole_WifiSsid , + eRole_WifiSecurityTypes , + eRole_WifiSignalLevel , + eRole_WifiSupported , + eRole_WifiConnected , + eRole_BLE_UNUSED , + }; - VIEW_DEC_CLASS(VDevice) + struct DataModel { + QString mWifiMacAddress ; + QString mWifiSSID ; + QString mWifiSecurityTypes ; + qint16 mWifiSignalLevel ; + bool mWifiSupported = false ; + bool mWifiConnected = false ; + QString mBle_Unused ; + }; + + QList _dataList; + +public: + int rowCount (const QModelIndex &parent = QModelIndex() ) const override; + QVariant data (const QModelIndex &vIndex, int vRole = Qt::DisplayRole ) const override; +private: + void addData (const DataModel &vDataModel); + +protected: + QHash roleNames() const override; + private slots: void onPOSTOSVersionData (const QString &vOSVersion);