This commit is contained in:
朱子楚\zhuzi
2024-02-27 12:23:24 +08:00
parent fce7f8c40c
commit 6749e47c22
29 changed files with 466 additions and 441 deletions

View File

@ -10,19 +10,14 @@
#include <QClipboard>
FluApp::FluApp(QObject *parent):QObject{parent}{
vsync(true);
useSystemAppBar(false);
}
FluApp::~FluApp(){
}
void FluApp::init(QObject *application){
this->_application = application;
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::init(QObject *target){
_engine = qmlEngine(target);
}
void FluApp::run(){
@ -31,11 +26,10 @@ void FluApp::run(){
void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegister* fluRegister){
if(!routes().contains(route)){
qCritical()<<"No route found "<<route;
qCritical()<<"Not Found Route "<<route;
return;
}
QQmlEngine *engine = qmlEngine(_application);
QQmlComponent component(engine, routes().value(route).toString());
QQmlComponent component(_engine, routes().value(route).toString());
if (component.isError()) {
qCritical() << component.errors();
return;