Atlas-Launcher/source/javascript/engine/AtlasJsEngine.cpp

20 lines
514 B
C++

#include "AtlasJsEngine.hpp"
#include "../module/AtlasJsModule.hpp"
namespace atlas::js {
AtlasJsEngine::AtlasJsEngine(QObject *parent) : QJSEngine(parent) {
// instanciate a new Atlas module
this->moduleAtlas = std::make_unique<AtlasJsModule>(this);
// convert it into a javascript object
const QJSValue jsModuleAtlas = this->newQObject(this->moduleAtlas.get());
// make it accessible as "atlas" in the javascript code
this->globalObject().setProperty("atlas", jsModuleAtlas);
}
}