mirror of
https://github.com/QuasarApp/SimpleQmlNotify.git
synced 2025-04-28 22:54:33 +00:00
24 lines
461 B
C++
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;
|
|
}
|
|
}
|
|
|