~fuchsi585/diabetes-diary-app/0.2

« back to all changes in this revision

Viewing changes to backend/modules/Diabetes_Diary_App/CarbsStore/carbsstore.h

  • Committer: fuchsi585
  • Date: 2016-02-04 20:00:20 UTC
  • Revision ID: ro.fuchs585@googlemail.com-20160204200020-cgu5y6c2nztq3j7n
modified favorite food page

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
{
13
13
    Q_OBJECT
14
14
    Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
15
 
    //Q_PROPERTY(bool bCanFetchMore READ bCanFetchMore NOTIFY bCanFetchMoreChanged)
16
15
 
17
16
public:
18
17
    enum Roles{
28
27
    Q_INVOKABLE void createEntry();
29
28
    Q_INVOKABLE void saveEntry(const int &id, const QString &name, const double &weight, const double &carbs);
30
29
    Q_INVOKABLE void removeEntry(int id);
31
 
    //Q_INVOKABLE void reloadAndFetchMore();
32
30
 
33
31
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
34
32
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
35
33
    QHash<int, QByteArray> roleNames() const;
36
34
 
37
35
protected:
38
 
    //bool bCanFetchMore();
39
36
 
40
37
signals:
41
38
    void countChanged();
42
 
    //void bCanFetchMoreChanged();
43
39
 
44
40
private:
45
41
    QList<Meal*> m_meals;
46
42
    QSqlQueryModel* m_SqlTableCarbsStore;
47
43
 
48
 
    //bool m_bCanFetchMore;
49
 
 
50
44
    void readSqlData();
51
45
    int indexOfId(const int &id);
52
46
};