On sending (posting) item to the server the generated UUID is added to the local item.
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user