4
0
mirror of https://github.com/QuasarApp/SimpleQmlNotify.git synced 2025-04-28 22:54:33 +00:00
SimpleQmlNotify/qmlnotifyservice.cpp
2019-11-19 18:09:01 +03:00

24 lines
461 B
C++

#include "notificationservice.h"
#include "qmlnotifyservice.h"
#include <QQmlApplicationEngine>
#include <QQmlContext>
namespace QmlNotificationService {
bool init(QQmlApplicationEngine *engine) {
if (!engine)
return false;
auto root = engine->rootContext();
if (!root)
return false;
engine->addImportPath(":/");
root->setContextProperty("notificationService", NotificationService::getService());
return true;
}
}