SimpleQmlNotify/qmlnotifyservice.cpp

19 lines
387 B
C++
Raw Normal View History

2019-11-19 15:20:38 +03:00
#include "notificationservice.h"
#include "qmlnotifyservice.h"
#include <QQmlApplicationEngine>
#include <QQmlContext>
namespace QmlNotificationService {
bool init(QQmlApplicationEngine *engine) {
auto root = engine->rootContext();
if (!root)
return false;
root->setContextProperty("notificationService", NotificationService::getService());
return true;
}
}