4
0
mirror of https://github.com/QuasarApp/SimpleQmlNotify.git synced 2025-05-03 08:49:37 +00:00
SimpleQmlNotify/qmlnotifyservice.cpp
2020-05-23 02:30:51 +03:00

31 lines
702 B
C++

/*
* Copyright (C) 2018-2020 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
#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;
}
}