This repository has been archived by the owner on Dec 11, 2018. It is now read-only.
forked from Aseman-Land/TelegramQML
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusernamefiltermodel.h
63 lines (46 loc) · 1.55 KB
/
usernamefiltermodel.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef USERNAMEFILTERMODEL_H
#define USERNAMEFILTERMODEL_H
#include "telegramqml_global.h"
#include "tgabstractlistmodel.h"
class DialogObject;
class TelegramQml;
class UserNameFilterModelPrivate;
class TELEGRAMQMLSHARED_EXPORT UserNameFilterModel : public TgAbstractListModel
{
Q_OBJECT
Q_ENUMS(FilterRoles)
Q_PROPERTY(TelegramQml* telegram READ telegram WRITE setTelegram NOTIFY telegramChanged)
Q_PROPERTY(DialogObject* dialog READ dialog WRITE setDialog NOTIFY dialogChanged)
Q_PROPERTY(QString keyword READ keyword WRITE setKeyword NOTIFY keywordChanged)
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
enum FilterRoles {
UserIdRole = Qt::UserRole
};
UserNameFilterModel(QObject *parent = 0);
~UserNameFilterModel();
TelegramQml *telegram() const;
void setTelegram(TelegramQml *tg );
DialogObject *dialog() const;
void setDialog(DialogObject *dialog);
qint64 id( const QModelIndex &index ) const;
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<qint32,QByteArray> roleNames() const;
int count() const;
void setKeyword(const QString &keyword);
QString keyword() const;
public Q_SLOTS:
void refresh();
qint64 get(int idx);
Q_SIGNALS:
void telegramChanged();
void countChanged();
void keywordChanged();
void dialogChanged();
private Q_SLOTS:
void listChanged();
private:
UserNameFilterModelPrivate *p;
};
#endif // USERNAMEFILTERMODEL_H