On sending (posting) item to the server the generated UUID is added to the local item.

This commit is contained in:
2026-02-02 16:13:44 +01:00
parent bedf8084d3
commit 63fe96fb2e
16 changed files with 145 additions and 33 deletions

View File

@ -8,7 +8,7 @@ class ModelItem;
using namespace std;
typedef QHash<int, QVariant> ModelItemValues;
typedef QMap<int, QVariant> ModelItemValues;
class TableModel : public QAbstractTableModel {
Q_OBJECT
@ -40,6 +40,8 @@ class TableModel : public QAbstractTableModel {
QByteArray jsonDataForServer(const QModelIndex& currentIndex) const;
QString updateItemsFromJson(const QByteArray& jsonData);
public slots:
// bool insertRows(int position, int rows, const QModelIndex& parentIndex = QModelIndex())
// override;
@ -68,6 +70,9 @@ class TableModel : public QAbstractTableModel {
QMap<int, QVariant> onlyChangedValues(const QModelIndex& index,
const QMap<int, QVariant>& roleValueMap) const;
bool isEmptyValueEqualToZero(const int role) const;
QModelIndex searchItemIndex(const ModelItemValues givenItemValues) const;
bool isItemEqualToItemValues(const QModelIndex& itemIndex,
const ModelItemValues givenItemValues) const;
};
#endif // TABLEMODEL_H