mirror of
https://github.com/QuasarApp/SimpleQmlNotify.git
synced 2025-05-14 14:19:33 +00:00
There were added countNotificationsChanged signal and connect with HistoryNotificationsModel
This commit is contained in:
parent
a5d21cb350
commit
50bc65df29
@ -14,6 +14,10 @@ NotificationService::NotificationService(QObject * ptr): QObject (ptr) {
|
|||||||
qRegisterMetaType<QList<NotificationData>> ("QList<NotificationData>");
|
qRegisterMetaType<QList<NotificationData>> ("QList<NotificationData>");
|
||||||
_history = new HistoryNotificationsModel();
|
_history = new HistoryNotificationsModel();
|
||||||
QQmlEngine::setObjectOwnership(_history, QQmlEngine::CppOwnership);
|
QQmlEngine::setObjectOwnership(_history, QQmlEngine::CppOwnership);
|
||||||
|
|
||||||
|
connect(_history, &HistoryNotificationsModel::rowsInserted, this, &NotificationService::countNotificationsChanged);
|
||||||
|
connect(_history, &HistoryNotificationsModel::rowsRemoved, this, &NotificationService::countNotificationsChanged);
|
||||||
|
connect(_history, &HistoryNotificationsModel::modelReset, this, &NotificationService::countNotificationsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationService::~NotificationService() {
|
NotificationService::~NotificationService() {
|
||||||
|
@ -158,6 +158,8 @@ public:
|
|||||||
|
|
||||||
void sigShowHistory();
|
void sigShowHistory();
|
||||||
|
|
||||||
|
void countNotificationsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
explicit NotificationService(QObject *ptr = nullptr);
|
explicit NotificationService(QObject *ptr = nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user