-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroupdata.h
39 lines (31 loc) · 1.01 KB
/
groupdata.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
// GroupData.h
#ifndef GROUPDATA_H
#define GROUPDATA_H
#include <QList>
#include <QObject>
#include "Message.h"
class GroupData : public QObject
{
Q_OBJECT
Q_PROPERTY(QList<Message *> messages READ messages WRITE setMessages NOTIFY messagesChanged)
Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged)
Q_PROPERTY(int currentScrollIndex READ currentScrollIndex WRITE setCurrentScrollIndex NOTIFY
currentScrollIndexChanged FINAL)
public:
GroupData(QObject *parent = nullptr);
QList<Message *> &messages();
void setMessages(const QList<Message *> &messages);
int currentPage() const;
void setCurrentPage(int page);
int currentScrollIndex() const;
void setCurrentScrollIndex(int newCurrentScrollIndex);
signals:
void messagesChanged();
void currentPageChanged();
void currentScrollIndexChanged();
private:
QList<Message *> m_messages;
int m_currentPage;
int m_currentScrollIndex;
};
#endif // GROUPDATA_H