/
NeoChapay
/
telegraf
Обзор
Документация
Войти
/
NeoChapay
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/contactsmodel.h
47 строк
1 KB
Mikhail Barashkov
refactor: remove standard comments from header of all source files
07 сен 2024, 14:40
07 сен 2024, 14:40
c79ea8f
Код
Авторство
О чём код?
#ifndef CONTACTSMODEL_H #define CONTACTSMODEL_H #include <QAbstractListModel> #include <QVariantList> #include "tdlibwrapper.h" class ContactsModel : public QAbstractListModel { Q_OBJECT public: enum ContactRole { RoleDisplay = Qt::DisplayRole, RolePhotoSmall, RoleTitle, RoleUserId, RoleUsername, RoleUserStatus, RoleUserLastOnline, RoleFilter }; ContactsModel(TDLibWrapper *tdLibWrapper, QObject *parent = nullptr); virtual QHash<int,QByteArray> roleNames() const override; virtual int rowCount(const QModelIndex &) const override; virtual QVariant data(const QModelIndex &index, int role) const override; Q_INVOKABLE void hydrateContacts(); Q_INVOKABLE void startImportingContacts(); Q_INVOKABLE void stopImportingContacts(); Q_INVOKABLE void importContact(const QVariantMap &singlePerson); public slots: void handleUsersReceived(const QString &extra, const QVariantList &userIds, int totalUsers); private: TDLibWrapper *tdLibWrapper; QVariantList contacts; QList<QString> contactIds; QString filter; QVariantList deviceContacts; }; #endif // CONTACTSMODEL_H