source: SMSSender/src/ui/models/grouptablemodel.h @ 67:578192d6fe64

3.0
Last change on this file since 67:578192d6fe64 was 67:578192d6fe64, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • added synchttp
  • backup before removing these diamond interfaces...
File size: 1.1 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:
13    GroupTableModel(QObject* parent = 0);
14    ~GroupTableModel();
15
16    enum Columns {
17        ColImage   = 0,
18        ColName    = 1,
19        ColMembers = 2,
20
21        MaxCol     = ColMembers
22    };
23
24    QVariant      headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
25    QVariant      data(const QModelIndex& index, int role = Qt::DisplayRole) const;
26    int           columnCount(const QModelIndex& parent = QModelIndex()) const;
27    int           rowCount(const QModelIndex& parent = QModelIndex()) const;
28    bool          removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
29
30    IGroup*       dataObject(const QModelIndex& index) const;
31
32public slots:
33    void groupUpdated(IGroup* contact);
34    void listAltered();
35
36private:
37    QList<IGroup*> items_;
38
39    QString        getMembersStr(const IGroup* group) const;
40    void           reloadList();
41};
42
43
44#endif // UI_GROUPTABLEMODEL_H
45
Note: See TracBrowser for help on using the repository browser.