/
NeoChapay
/
telegraf
Обзор
Документация
Войти
/
NeoChapay
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/chatlistsortedmodel.h
36 строк
1 KB
mbarashkov
Исправлены разные предупреждения
28 дек 2024, 18:43
28 дек 2024, 18:43
5fae12c
Код
Авторство
О чём код?
#pragma once #include <QSortFilterProxyModel> class ChatListSortedModel : public QSortFilterProxyModel { Q_OBJECT Q_PROPERTY(QObject* sourceModel READ sourceModel WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(qlonglong folderID READ getFolderId CONSTANT) Q_PROPERTY(QString folderType READ getFolderType CONSTANT) QString chosenFolder; qlonglong selectedFolderID; public: explicit ChatListSortedModel(QObject *parent = Q_NULLPTR); Q_INVOKABLE void sortNow() { sort(0, Qt::DescendingOrder); } void setSource(QObject* model); void setSourceModel(QAbstractItemModel *model) Q_DECL_OVERRIDE; qlonglong getFolderId() const; QString getFolderType() const; Q_INVOKABLE bool isPinnedChat(qlonglong chatId); //void countChanged(const QModelIndex &parent, int first, int last); Q_INVOKABLE qlonglong unreadCount(); Q_SIGNALS: void sourceChanged(); protected: bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const Q_DECL_OVERRIDE; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE; };