Add save and revert button to datagrid no implicit saves any more.

This commit is contained in:
eelke 2026-10-18 11:34:00 +02:00
parent 66267334c8
commit ee1a8ba48d
9 changed files with 153 additions and 12 deletions

View file

@ -46,12 +46,21 @@ public:
void loadData();
/// True when there are edits that have not been saved to the database
bool hasPendingChanges() const { return !m_pendingRowList.m_rows.empty(); }
/// Writes all pending rows to the database, rows that fail stay pending
bool saveChanges();
/// Discards all pending edits, the grid shows the last saved values again
void revertChanges();
std::tuple<bool, QString> removeRows(const std::set<IntegerRange<int>> &row_ranges);
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
signals:
/// Emitted when the model goes from clean to having pending changes or back
void pendingChangesChanged(bool hasChanges);
public slots:
virtual bool submit() override;
virtual void revert() override;
private: