10#include <QAbstractTableModel>
57 Qt::Orientation orientation,
58 int role = Qt::DisplayRole)
const override;
64 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
70 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
81 QVariant
data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
87 Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
Header for the BackupTarget struct.
static constexpr int num_targets_role
Role representing the total number of target.
Definition backuplistmodel.h:41
static constexpr int backup_name_role
Role representing the name of the currently active backup for a target.
Definition backuplistmodel.h:45
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns to display.
Definition backuplistmodel.cpp:32
std::vector< BackupTarget > targets_
Stores data for all displayed backup targets.
Definition backuplistmodel.h:106
static constexpr int path_col
Index of the path column.
Definition backuplistmodel.h:33
static constexpr int target_path_role
Role representing the path for a target.
Definition backuplistmodel.h:47
static constexpr int num_backups_role
Role representing the number of backups for a target.
Definition backuplistmodel.h:39
void setBackupTargets(const std::vector< BackupTarget > &targets)
Sets the data for all backup targets.
Definition backuplistmodel.cpp:105
void setIsEditable(bool is_editable)
Enables or disables the ability to edit this models data in a view.
Definition backuplistmodel.cpp:112
static constexpr int active_index_role
Role representing the id of the currently active backup for a target.
Definition backuplistmodel.h:37
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns the horizontal header section names.
Definition backuplistmodel.cpp:9
bool is_editable_
Stores whether the model can be edited in a view.
Definition backuplistmodel.h:108
static constexpr int backup_col
Index of the backup column.
Definition backuplistmodel.h:31
static constexpr int action_col
Index of the action column.
Definition backuplistmodel.h:27
static constexpr int target_name_role
Role representing the name of a target.
Definition backuplistmodel.h:43
static constexpr int target_col
Index of the target column.
Definition backuplistmodel.h:29
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Used to access the data stored in this model.
Definition backuplistmodel.cpp:37
BackupListModel(QObject *parent=nullptr)
Constructor.
Definition backuplistmodel.cpp:7
bool isEditable() const
Checks if the model is currently editable.
Definition backuplistmodel.cpp:117
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows to display.
Definition backuplistmodel.cpp:27
static constexpr int backup_list_role
Role representing the list of backups for a target.
Definition backuplistmodel.h:35
static constexpr int active_index_role
Role representing the active member of the group a mod belongs to.
Definition modlistmodel.h:51
uint8_t flags
Flags indicating compression type.
Definition lspakfilelistentry.h:7
Header for the ModListModel class.