Items are loaded from default JSON file in standard location at startup. If no items are found in file, example items are generated.
This commit is contained in:
@ -19,6 +19,7 @@ class TableModel : public QAbstractTableModel {
|
||||
enum UserRoles { NameRole = Qt::UserRole + 1, DescriptionRole, InfoRole, AmountRole, FactorRole };
|
||||
static QHash<int, QByteArray> ROLE_NAMES;
|
||||
static QList<QString> intColumns;
|
||||
static QByteArray generateExampleItems();
|
||||
|
||||
explicit TableModel(QUndoStack* undoStack, QObject* parent = nullptr);
|
||||
|
||||
@ -41,7 +42,9 @@ class TableModel : public QAbstractTableModel {
|
||||
// override;
|
||||
bool removeRows(int firstRow, int nRows, const QModelIndex& parentIndex = QModelIndex()) override;
|
||||
void appendItems(const QByteArray& jsonDoc);
|
||||
void insertItems(int startPosition, const QByteArray& jsonDoc, const QModelIndex& parentIndex);
|
||||
void insertItems(int startPosition,
|
||||
const QByteArray& jsonDoc,
|
||||
const QModelIndex& parentIndex = QModelIndex());
|
||||
|
||||
private:
|
||||
/// *** members ***
|
||||
|
||||
Reference in New Issue
Block a user