source: SMSSender/src/ui/models/grouptablemodel.h @ 55:33dc8614a999

3.0
Last change on this file since 55:33dc8614a999 was 55:33dc8614a999, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Added group-/contacttablemodel
  • Updated accountmodel
  • Implemented MVC in addressbook
File size: 1.0 KB
Line 
1#ifndef UI_GROUPTABLEMODEL_H
2#define UI_GROUPTABLEMODEL_H
3
4#include <QObject>
5#include <QAbstractTableModel>
6
7#include <igroup.h>
8
9class GroupTableModel: public QAbstractTableModel {
10    Q_OBJECT
11
12public slots:
13    void groupUpdated(IGroup* contact);
14
15public:
16    GroupTableModel(QObject* parent = 0);
17    ~GroupTableModel();
18
19    enum Columns {
20        ColImage   = 0,
21        ColName    = 1,
22        ColMembers = 2,
23
24        MaxCol     = ColMembers
25    };
26
27    QVariant      headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
28    QVariant      data(const QModelIndex& index, int role = Qt::DisplayRole) const;
29    int           columnCount(const QModelIndex& parent = QModelIndex()) const;
30    int           rowCount(const QModelIndex& parent = QModelIndex()) const;
31    bool          removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
32
33    IGroup*       dataObject(const QModelIndex& index) const;
34
35private:
36    QString       getMembersStr(const IGroup* group) const;
37};
38
39
40#endif // UI_GROUPTABLEMODEL_H
41
Note: See TracBrowser for help on using the repository browser.