ViewSolutions
1.0.100.30ae2aa
View solutions of qml for quasarapp projects
Toggle main menu visibility
Loading...
Searching...
No Matches
historynotificationsmodel.h
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2020-2025 QuasarApp.
3
//# Distributed under the GPLv3 software license, see the accompanying
4
//# Everyone is permitted to copy and distribute verbatim copies
5
//# of this license document, but changing it is not allowed.
6
//#
7
8
#ifndef HISTORYNOTIFICATIONMODEL_H
9
#define HISTORYNOTIFICATIONMODEL_H
10
11
#include <QAbstractListModel>
12
#include "
notificationdata.h
"
13
namespace
ViewSolutions
{
14
38
class
VIEWSOLUTION_EXPORT
HistoryNotificationsModel
:
public
QAbstractListModel
39
{
40
Q_OBJECT
41
45
enum
Roles {
47
Icon = Qt::UserRole + 1,
49
Title,
51
Message,
53
Type
54
};
55
56
public
:
57
explicit
HistoryNotificationsModel
(QObject *parent =
nullptr
);
58
59
int
rowCount
(
const
QModelIndex &parent)
const override
;
60
QVariant
data
(
const
QModelIndex &index,
int
role)
const override
;
61
QHash<int, QByteArray>
roleNames
()
const override
;
62
67
void
addHistoryObject
(
const
ViewSolutions::NotificationData
¬ificationData);
68
73
void
setHistory
(
const
QList<ViewSolutions::NotificationData> &historyList);
74
78
Q_INVOKABLE
void
clearAllHistory
();
79
85
Q_INVOKABLE
void
removeNotificationItemAtIndex
(
const
int
index);
86
87
private
:
88
QList<ViewSolutions::NotificationData> notificationsList;
89
};
90
}
91
#endif
// HISTORYNOTIFICATIONMODEL_H
ViewSolutions::HistoryNotificationsModel::setHistory
void setHistory(const QList< ViewSolutions::NotificationData > &historyList)
setHistory replaces the complete history list with a new one.
Definition
historynotificationsmodel.cpp:57
ViewSolutions::HistoryNotificationsModel::clearAllHistory
Q_INVOKABLE void clearAllHistory()
clearAllHistory removes all notifications from the history.
Definition
historynotificationsmodel.cpp:61
ViewSolutions::HistoryNotificationsModel::data
QVariant data(const QModelIndex &index, int role) const override
Definition
historynotificationsmodel.cpp:22
ViewSolutions::HistoryNotificationsModel::removeNotificationItemAtIndex
Q_INVOKABLE void removeNotificationItemAtIndex(const int index)
removeNotificationItemAtIndex removes one notification from the history list.
Definition
historynotificationsmodel.cpp:67
ViewSolutions::HistoryNotificationsModel::rowCount
int rowCount(const QModelIndex &parent) const override
Definition
historynotificationsmodel.cpp:17
ViewSolutions::HistoryNotificationsModel::addHistoryObject
void addHistoryObject(const ViewSolutions::NotificationData ¬ificationData)
addHistoryObject adds a new notification to the history list.
Definition
historynotificationsmodel.cpp:51
ViewSolutions::HistoryNotificationsModel::roleNames
QHash< int, QByteArray > roleNames() const override
Definition
historynotificationsmodel.cpp:41
ViewSolutions::HistoryNotificationsModel::HistoryNotificationsModel
HistoryNotificationsModel(QObject *parent=nullptr)
Definition
historynotificationsmodel.cpp:13
ViewSolutions::NotificationData
The NotificationData class view data for NotificationServiceView. This class contains a structure wit...
Definition
notificationdata.h:28
ViewSolutions
The ViewSolutions namespace.
Definition
avatargenerator.cpp:14
notificationdata.h
VIEWSOLUTION_EXPORT
#define VIEWSOLUTION_EXPORT
VIEWSOLUTION_EXPORT marks a symbol as part of the public ViewSolutions API.
Definition
viewsolutions_global.h:33
ViewSolutions
src
historynotificationsmodel.h
Generated by
1.18.0