Using the typedef ModelItemValues for "QHash<int, QVariant>".
This commit is contained in:
@ -8,6 +8,8 @@ class ModelItem;
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef QHash<int, QVariant> ModelItemValues;
|
||||
|
||||
class TableModel : public QAbstractTableModel {
|
||||
Q_OBJECT
|
||||
|
||||
@ -32,7 +34,7 @@ class TableModel : public QAbstractTableModel {
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role) override;
|
||||
bool setItemData(const QModelIndex& index, const QMap<int, QVariant>& roles) override;
|
||||
|
||||
QHash<int, QVariant> getItemValues(const QModelIndex& index) const;
|
||||
ModelItemValues getItemValues(const QModelIndex& index) const;
|
||||
QJsonDocument getAllItemsAsJsonDoc() const;
|
||||
|
||||
public slots:
|
||||
@ -44,7 +46,7 @@ class TableModel : public QAbstractTableModel {
|
||||
const QByteArray& jsonDoc,
|
||||
const QModelIndex& parentIndex = QModelIndex());
|
||||
void insertItems(int startPosition,
|
||||
const QList<QHash<int, QVariant>>& itemValuesList,
|
||||
const QList<ModelItemValues>& itemValuesList,
|
||||
const QModelIndex& parentIndex = QModelIndex());
|
||||
|
||||
private:
|
||||
@ -55,7 +57,7 @@ class TableModel : public QAbstractTableModel {
|
||||
|
||||
/// *** functions ***
|
||||
/// undo/redo functions
|
||||
void execInsertItems(const int firstRow, const QList<QHash<int, QVariant>> valueList);
|
||||
void execInsertItems(const int firstRow, const QList<ModelItemValues> valueList);
|
||||
void execRemoveItems(const int firstRow, const int nRows);
|
||||
void execEditItemData(const int row, const QMap<int, QVariant>& changedValues);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user