mirror of
https://github.com/QuasarApp/SimpleQmlNotify.git
synced 2025-04-26 05:34:34 +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>");
|
||||
_history = new HistoryNotificationsModel();
|
||||
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() {
|
||||
|
@ -158,6 +158,8 @@ public:
|
||||
|
||||
void sigShowHistory();
|
||||
|
||||
void countNotificationsChanged();
|
||||
|
||||
private:
|
||||
|
||||
explicit NotificationService(QObject *ptr = nullptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user