1 #include "FingerManagerDevicesModel.h"
3 FingerManagerDevicesModel::FingerManagerDevicesModel(QObject
*parent
) :
4 QAbstractListModel(parent
) {
7 FingerManagerDevicesModel::~FingerManagerDevicesModel() {
11 void FingerManagerDevicesModel::setDefault(QString dev
) {
12 for (int i
= 0; i
< devices
.size(); i
++) {
13 if (devices
.at(i
).device
== dev
) {
20 int FingerManagerDevicesModel::getDefault() {
24 void FingerManagerDevicesModel::addDevice(QString device
, QString name
) {
31 int FingerManagerDevicesModel::rowCount(const QModelIndex
& parent
) const {
33 return(devices
.size());
36 QVariant
FingerManagerDevicesModel::data(const QModelIndex
& index
, int role
) const {
38 if (role
== Qt::DisplayRole
) {
39 result
= devices
.at(index
.row()).name
;
44 QString
FingerManagerDevicesModel::getDeviceName(int row
) {
45 return(devices
.at(row
).name
);
48 QString
FingerManagerDevicesModel::getDevicePath(int row
) {
49 return(devices
.at(row
).device
);
52 DeviceModel
FingerManagerDevicesModel::getDeviceModel(int row
) {
53 return(devices
.at(row
));