19#include <QAbstractItemModel>
43 UatModel(QObject *parent, QString tableName);
50 Qt::ItemFlags
flags(
const QModelIndex &index)
const;
58 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
67 QVariant
headerData(
int section, Qt::Orientation orientation,
68 int role = Qt::DisplayRole)
const;
75 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
82 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
91 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
100 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
109 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
123 QModelIndex
copyRow(QModelIndex original);
131 bool moveRow(
int src_row,
int dst_row);
142 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
const QModelIndex &destinationParent,
int destinationChild);
160 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent);
202 QModelIndex
findRowForColumnContent(QVariant columnContent,
int columnToCheckAgainst,
int role = Qt::DisplayRole);
212 bool checkField(
int row,
int col,
char **error)
const;
219 QList<int> checkRow(
int row);
225 void loadUat(
uat_t * uat = 0);
233 bool moveRowPrivate(
int src_row,
int dst_row);
242 QVector<bool> dirty_records;
245 QVector<QMap<int, QString> > record_errors;
Table model for representing and managing User Accessible Tables (UAT).
Definition uat_model.h:28
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Handles dropped MIME data to perform drag and drop operations.
Definition uat_model.cpp:666
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Removes a specified number of rows from the model.
Definition uat_model.cpp:475
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns under a given parent.
Definition uat_model.cpp:304
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Retrieves header data for the table.
Definition uat_model.cpp:277
Qt::DropActions supportedDropActions() const
Returns the supported drag and drop actions for the model.
Definition uat_model.cpp:661
bool revertChanges(QString &error)
Definition uat_model.cpp:100
bool applyChanges(QString &error)
Definition uat_model.cpp:75
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Retrieves data for a given index and role.
Definition uat_model.cpp:172
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for a given index.
Definition uat_model.cpp:118
QModelIndex appendEntry(QVariantList row)
Appends a new entry to the end of the table.
Definition uat_model.cpp:314
bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
Moves multiple rows from one position to another.
Definition uat_model.cpp:577
void clearAll()
Clears all entries from the model.
Definition uat_model.cpp:492
bool moveRow(int src_row, int dst_row)
Moves a row from one position to another.
Definition uat_model.cpp:572
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
Inserts a specified number of rows into the model.
Definition uat_model.cpp:444
QModelIndex copyRow(QModelIndex original)
Copies an existing row and inserts the copy.
Definition uat_model.cpp:505
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows under a given parent.
Definition uat_model.cpp:294
QModelIndex findRowForColumnContent(QVariant columnContent, int columnToCheckAgainst, int role=Qt::DisplayRole)
Finds the first row containing specific content in a given column.
Definition uat_model.cpp:262
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the data for a specific index.
Definition uat_model.cpp:367
void reloadUat()
Reloads the UAT data from the underlying structure.
Definition uat_model.cpp:61
bool hasErrors() const
Checks if any records in the model currently have validation errors.
Definition uat_model.cpp:608
Represents a User Accessible Table (UAT), managing a set of user-editable records exposed to a dissec...
Definition uat-int.h:44