diff --git a/example/qml/App.qml b/example/qml/App.qml index 7b50e37b..676e8fb9 100644 --- a/example/qml/App.qml +++ b/example/qml/App.qml @@ -45,5 +45,6 @@ Item { } FluApp.initialRoute = "/" FluApp.run() + __fluentui() } } diff --git a/src/FluApp.cpp b/src/FluApp.cpp index 9137ff5e..25ab69cc 100644 --- a/src/FluApp.cpp +++ b/src/FluApp.cpp @@ -29,6 +29,10 @@ void FluApp::init(QObject *application){ FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow); QQmlEngine *engine = qmlEngine(_application); FramelessHelper::Quick::registerTypes(engine); + QJSEngine * jsEngine = qjsEngine(_application); + std::string jsFunction = R"( (function () { console.log("FluentUI");}) )"; + QJSValue function = jsEngine->evaluate(QString::fromStdString(jsFunction)); + jsEngine->globalObject().setProperty("__fluentui",function); } void FluApp::run(){