-
Notifications
You must be signed in to change notification settings - Fork 2
/
drthreadslistmodel.h
35 lines (26 loc) · 1.01 KB
/
drthreadslistmodel.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
27
28
29
30
31
32
33
34
35
#ifndef DRTHREADSLISTMODEL_H
#define DRTHREADSLISTMODEL_H
#include <QObject>
#include <QAbstractListModel>
#include "drconnection.h"
#include "drthreaditem.h"
class DRThreadsListModel : public QAbstractListModel
{
Q_OBJECT
public:
DRThreadsListModel(DRServerConnection *connection, QObject *parent = 0);
void clear();
bool appendRow(DRThreadItem *item);
bool appendRow(QList<DRThreadItem*> threadItems);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
private:
QList<DRThreadItem*> threadItems;
DRServerConnection *connection;
};
#endif // DRTHREADSLISTMODEL_H