OpenHantek
deviceslistmodel.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QAbstractTableModel>
6 #include "devicelistentry.h"
7 
8 class FindDevices;
9 
14 class DevicesListModel: public QAbstractTableModel {
15 public:
17  // QAbstractItemModel interface
18  int rowCount(const QModelIndex &parent) const override;
19  int columnCount(const QModelIndex &parent) const override;
20  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
21  QVariant data(const QModelIndex &index, int role) const override;
22  void updateDeviceList();
23 private:
24  std::vector<DeviceListEntry> entries;
26 };
Definition: deviceslistmodel.h:14
Search for Hantek devices. Use usually want to call updateDeviceList and then retrieve the list via g...
Definition: finddevices.h:23
FindDevices * findDevices
Definition: deviceslistmodel.h:25
int rowCount(const QModelIndex &parent) const override
Definition: deviceslistmodel.cpp:12
int columnCount(const QModelIndex &parent) const override
Definition: deviceslistmodel.cpp:17
void updateDeviceList()
Definition: deviceslistmodel.cpp:61
DevicesListModel(FindDevices *findDevices)
Definition: deviceslistmodel.cpp:10
QVariant data(const QModelIndex &index, int role) const override
Definition: deviceslistmodel.cpp:36
std::vector< DeviceListEntry > entries
Definition: deviceslistmodel.h:24
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition: deviceslistmodel.cpp:22