OpenHantek
deviceslistmodel.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include "devicelistentry.h"
6 #include <QAbstractTableModel>
7 
8 class FindDevices;
9 
14 class DevicesListModel : public QAbstractTableModel {
15  public:
16  explicit DevicesListModel( FindDevices *findDevices, unsigned verboseLevel = 0 );
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 
24  private:
25  std::vector< DeviceListEntry > entries;
27  unsigned verboseLevel = 0;
28 };
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
DevicesListModel(FindDevices *findDevices, unsigned verboseLevel=0)
Definition: deviceslistmodel.cpp:10
FindDevices * findDevices
Definition: deviceslistmodel.h:26
int rowCount(const QModelIndex &parent) const override
Definition: deviceslistmodel.cpp:13
int columnCount(const QModelIndex &parent) const override
Definition: deviceslistmodel.cpp:15
void updateDeviceList()
Definition: deviceslistmodel.cpp:64
QVariant data(const QModelIndex &index, int role) const override
Definition: deviceslistmodel.cpp:33
unsigned verboseLevel
Definition: deviceslistmodel.h:27
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition: deviceslistmodel.cpp:17
std::vector< DeviceListEntry > entries
Definition: deviceslistmodel.h:25