mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Qt/QML edition
This commit is contained in:
commit
d7b361ba44
2168 changed files with 721948 additions and 0 deletions
34
drivelistmodel.h
Normal file
34
drivelistmodel.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#ifndef DRIVELISTMODEL_H
|
||||
#define DRIVELISTMODEL_H
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (C) 2020 Raspberry Pi (Trading) Limited
|
||||
*/
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QMap>
|
||||
#include <QHash>
|
||||
#include "drivelistitem.h"
|
||||
|
||||
class DriveListModel : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
DriveListModel(QObject *parent = nullptr);
|
||||
virtual int rowCount(const QModelIndex &) const;
|
||||
virtual QHash<int, QByteArray> roleNames() const;
|
||||
virtual QVariant data(const QModelIndex &index, int role) const;
|
||||
|
||||
enum driveListRoles {
|
||||
deviceRole = Qt::UserRole + 1, descriptionRole, sizeRole, isUsbRole, isScsiRole, mountpointsRole
|
||||
};
|
||||
|
||||
public slots:
|
||||
void refreshDriveList();
|
||||
|
||||
protected:
|
||||
QMap<QString,DriveListItem *> _drivelist;
|
||||
QHash<int, QByteArray> _rolenames;
|
||||
};
|
||||
|
||||
#endif // DRIVELISTMODEL_H
|
Loading…
Add table
Add a link
Reference in a new issue