qt5base-lts/examples/widgets/itemviews/storageview/storagemodel.h
Lucie Gérard 05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00

47 lines
1.1 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2016 Ivan Komissarov
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef STORAGEMODEL_H
#define STORAGEMODEL_H
#include <QAbstractTableModel>
#include <QStorageInfo>
class StorageModel : public QAbstractTableModel
{
Q_OBJECT
Q_DISABLE_COPY(StorageModel)
public:
enum Column {
ColumnRootPath = 0,
ColumnName,
ColumnDevice,
ColumnFileSystemName,
ColumnTotal,
ColumnFree,
ColumnAvailable,
ColumnIsReady,
ColumnIsReadOnly,
ColumnIsValid,
ColumnCount
};
using QAbstractTableModel::QAbstractTableModel;
int columnCount(const QModelIndex &parent) const override;
int rowCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
public slots:
void refresh();
private:
QList<QStorageInfo> m_volumes;
};
#endif // STORAGEMODEL_H