OpenHantek
Loading...
Searching...
No Matches
rawdeviceslistmodel.h
1// SPDX-License-Identifier: GPL-2.0+
2#pragma once
3
4#include <QAbstractTableModel>
5#include "rawdevicelistentry.h"
6#include "usb/usbdevice.h"
7
12class RawDevicesListModel: public QAbstractTableModel {
13public:
14 RawDevicesListModel(libusb_context *context, QObject *parent = 0);
15 // QAbstractItemModel interface
16 virtual int rowCount(const QModelIndex &parent) const override;
17 virtual int columnCount(const QModelIndex &parent) const override;
18 virtual QVariant data(const QModelIndex &index, int role) const override;
19 void updateDeviceList();
20
21 enum Roles {
22 ProductIDRole = Qt::UserRole+0,
23 VendorIDRole = Qt::UserRole+1,
24 AccessRole = Qt::UserRole+2,
25 DeviceNameRole = Qt::UserRole+3,
26 EntryPointerRole = Qt::UserRole+4
27 };
28private:
29 std::vector<RawDeviceListEntry> entries;
30 libusb_context *context;
31};
Definition rawdeviceslistmodel.h:12