ViewSolutions 1.0.100.30ae2aa
View solutions of qml for quasarapp projects
Loading...
Searching...
No Matches
ViewSolutions::HistoryNotificationsModel Class Reference

The HistoryNotificationsModel class stores the history of all sent notification messages. More...

#include <historynotificationsmodel.h>

Inheritance diagram for ViewSolutions::HistoryNotificationsModel:
Inheritance graph
Collaboration diagram for ViewSolutions::HistoryNotificationsModel:
Collaboration graph

Public Member Functions

 HistoryNotificationsModel (QObject *parent=nullptr)
int rowCount (const QModelIndex &parent) const override
QVariant data (const QModelIndex &index, int role) const override
QHash< int, QByteArray > roleNames () const override
void addHistoryObject (const ViewSolutions::NotificationData &notificationData)
 addHistoryObject adds a new notification to the history list.
void setHistory (const QList< ViewSolutions::NotificationData > &historyList)
 setHistory replaces the complete history list with a new one.
Q_INVOKABLE void clearAllHistory ()
 clearAllHistory removes all notifications from the history.
Q_INVOKABLE void removeNotificationItemAtIndex (const int index)
 removeNotificationItemAtIndex removes one notification from the history list.

Detailed Description

The HistoryNotificationsModel class stores the history of all sent notification messages.

This model is used by the NotificationHistoryView to display the list of all notifications that were shown by the NotificationService.

Each row of the model exposes the following roles:

  • icon - url of the notification image
  • title - notification title
  • text - notification message
  • type - notification type code (see NotificationData::Type)

Example:

ViewSolutions::NotificationData("Title", "Message"));
history.clearAllHistory();
The HistoryNotificationsModel class stores the history of all sent notification messages.
Q_INVOKABLE void clearAllHistory()
clearAllHistory removes all notifications from the history.
Q_INVOKABLE void removeNotificationItemAtIndex(const int index)
removeNotificationItemAtIndex removes one notification from the history list.
void addHistoryObject(const ViewSolutions::NotificationData &notificationData)
addHistoryObject adds a new notification to the history list.
The NotificationData class view data for NotificationServiceView. This class contains a structure wit...

Definition at line 38 of file historynotificationsmodel.h.

Constructor & Destructor Documentation

◆ HistoryNotificationsModel()

ViewSolutions::HistoryNotificationsModel::HistoryNotificationsModel ( QObject * parent = nullptr)
explicit

Definition at line 13 of file historynotificationsmodel.cpp.

Member Function Documentation

◆ addHistoryObject()

void ViewSolutions::HistoryNotificationsModel::addHistoryObject ( const ViewSolutions::NotificationData & notificationData)

addHistoryObject adds a new notification to the history list.

Parameters
notificationDatais data of the notification.

Definition at line 51 of file historynotificationsmodel.cpp.

Here is the call graph for this function:

◆ clearAllHistory()

void ViewSolutions::HistoryNotificationsModel::clearAllHistory ( )

clearAllHistory removes all notifications from the history.

Definition at line 61 of file historynotificationsmodel.cpp.

◆ data()

QVariant ViewSolutions::HistoryNotificationsModel::data ( const QModelIndex & index,
int role ) const
override

Definition at line 22 of file historynotificationsmodel.cpp.

◆ removeNotificationItemAtIndex()

void ViewSolutions::HistoryNotificationsModel::removeNotificationItemAtIndex ( const int index)

removeNotificationItemAtIndex removes one notification from the history list.

Parameters
indexis the index of the notification that should be removed.

Definition at line 67 of file historynotificationsmodel.cpp.

◆ roleNames()

QHash< int, QByteArray > ViewSolutions::HistoryNotificationsModel::roleNames ( ) const
override

Definition at line 41 of file historynotificationsmodel.cpp.

◆ rowCount()

int ViewSolutions::HistoryNotificationsModel::rowCount ( const QModelIndex & parent) const
override

Definition at line 17 of file historynotificationsmodel.cpp.

Here is the caller graph for this function:

◆ setHistory()

void ViewSolutions::HistoryNotificationsModel::setHistory ( const QList< ViewSolutions::NotificationData > & historyList)

setHistory replaces the complete history list with a new one.

Parameters
historyListis the new history list.

Definition at line 57 of file historynotificationsmodel.cpp.


The documentation for this class was generated from the following files: