comparison src/main.h @ 109:62e570222f66

Return inserted person ID from addPerson() (or negative value in case of errors.)
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 04 Jul 2017 09:53:38 +0300
parents 6d02b4ae936c
children 2524434a7193
comparison
equal deleted inserted replaced
108:bb17f6714fa4 109:62e570222f66
66 PersonSQLModel(QObject *parent = 0); 66 PersonSQLModel(QObject *parent = 0);
67 67
68 QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; 68 QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE;
69 69
70 int updatePerson(const PersonInfo &person); 70 int updatePerson(const PersonInfo &person);
71 int addPerson(const PersonInfo &person); 71 qint64 addPerson(const PersonInfo &person);
72 int deletePerson(qint64 id); 72 int deletePerson(qint64 id);
73 void updateModel(); 73 void updateModel();
74 }; 74 };
75 75
76 76
118 int addTransactionGUI(qint64 id, bool debt, double value); 118 int addTransactionGUI(qint64 id, bool debt, double value);
119 void updatePersonList(); 119 void updatePersonList();
120 120
121 PersonSQLModel *model_People; 121 PersonSQLModel *model_People;
122 122
123 public slots:
124 void focusDebtEdit();
125
123 private slots: 126 private slots:
124 void on_button_AddPerson_clicked(); 127 void on_button_AddPerson_clicked();
125 void on_button_EditPerson_clicked(); 128 void on_button_EditPerson_clicked();
126 void on_button_DeletePerson_clicked(); 129 void on_button_DeletePerson_clicked();
127 130
137 140
138 void on_tableview_People_doubleClicked(const QModelIndex &index); 141 void on_tableview_People_doubleClicked(const QModelIndex &index);
139 142
140 void selectedPersonChanged(const QModelIndex &, const QModelIndex &); 143 void selectedPersonChanged(const QModelIndex &, const QModelIndex &);
141 144
142 void focusDebtEdit();
143 void selectRowPrev(); 145 void selectRowPrev();
144 void selectRowNext(); 146 void selectRowNext();
145 147
146 void changeUIZoomIn(); 148 void changeUIZoomIn();
147 void changeUIZoomOut(); 149 void changeUIZoomOut();