-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqldebtormodel.h
26 lines (20 loc) · 996 Bytes
/
sqldebtormodel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef SQLDEBTORMODEL_H
#define SQLDEBTORMODEL_H
#include <QSqlRelationalTableModel>
class SqlDebtorModel : public QSqlRelationalTableModel
{
Q_OBJECT
public:
SqlDebtorModel(QObject *parent=0);
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
Q_INVOKABLE QVariantMap get(int row) const;
Q_INVOKABLE void append(const QString &name, const QString &surename, const QString &phone, const QString &email, const QString &comment, const int &address);
Q_INVOKABLE void set(int row, const QString &name, const QString &surename, const QString &phone, const QString &email, const QString &comment, const int &address);
Q_INVOKABLE void remove(int index);
Q_INVOKABLE void filterModel(const QString filter, const QString columnName);
Q_INVOKABLE void sortBy(const QString columnName);
private:
int addressField;
};
#endif // SQLDEBTORMODEL_H