3.0
Last change
on this file since 56:e63ceb8090cd was
56:e63ceb8090cd,
checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
|
- Renamed accountmodel to accounttreemodel
- Implemented creation of new contact if number is unknown in vcmain
- Areacode is now in its own field in vceditcontact
- Accountlist in vcmain is now controlled by a model (Needs filtering of only active ones)
- Settingspath is dynamic and user-based now
|
File size:
1.2 KB
|
Line | |
---|
1 | #ifndef UI_ACCOUNTTREEMODEL_H |
---|
2 | #define UI_ACCOUNTTREEMODEL_H |
---|
3 | |
---|
4 | #include <QObject> |
---|
5 | #include <QAbstractTableModel> |
---|
6 | |
---|
7 | #include <iaccount.h> |
---|
8 | #include "../../business/BCAccountManager.h" |
---|
9 | |
---|
10 | class AccountTreeModel: public QAbstractTableModel { |
---|
11 | Q_OBJECT |
---|
12 | |
---|
13 | public slots: |
---|
14 | void accountUpdated(IAccount* account); |
---|
15 | |
---|
16 | public: |
---|
17 | AccountTreeModel(QObject* parent = 0); |
---|
18 | ~AccountTreeModel(); |
---|
19 | |
---|
20 | enum Columns { |
---|
21 | ColEnabled = 0, |
---|
22 | ColName = 1, |
---|
23 | ColGatewayName = 2, |
---|
24 | |
---|
25 | MaxCol = ColGatewayName |
---|
26 | }; |
---|
27 | |
---|
28 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; |
---|
29 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; |
---|
30 | int columnCount(const QModelIndex& parent = QModelIndex()) const; |
---|
31 | int rowCount(const QModelIndex& parent = QModelIndex()) const; |
---|
32 | bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); |
---|
33 | Qt::ItemFlags flags(const QModelIndex& index) const; |
---|
34 | bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); |
---|
35 | |
---|
36 | IAccount* dataObject(const QModelIndex& index) const; |
---|
37 | }; |
---|
38 | |
---|
39 | |
---|
40 | #endif // UI_ACCOUNTTREEMODEL_H |
---|
41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.