mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-04 17:15:29 +08:00
update
This commit is contained in:
@ -10,7 +10,3 @@ AppInfo::AppInfo(QObject *parent)
|
||||
{
|
||||
version(APPLICATION_VERSION);
|
||||
}
|
||||
|
||||
void AppInfo::init(QQmlApplicationEngine *engine){
|
||||
engine->rootContext();
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ private:
|
||||
explicit AppInfo(QObject *parent = nullptr);
|
||||
public:
|
||||
SINGLETONG(AppInfo)
|
||||
void init(QQmlApplicationEngine *engine);
|
||||
};
|
||||
|
||||
#endif // APPINFO_H
|
||||
|
@ -19,8 +19,6 @@ public:
|
||||
SINGLETONG(SettingsHelper)
|
||||
~SettingsHelper() override;
|
||||
void init(char *argv[]);
|
||||
Q_INVOKABLE void saveRender(const QVariant& render){save("render",render);}
|
||||
Q_INVOKABLE QString getRender(){return get("render").toString();}
|
||||
Q_INVOKABLE void saveDarkMode(int darkModel){save("darkMode",darkModel);}
|
||||
Q_INVOKABLE int getDarkMode(){return get("darkMode",QVariant(0)).toInt();}
|
||||
Q_INVOKABLE void saveUseSystemAppBar(bool useSystemAppBar){save("useSystemAppBar",useSystemAppBar);}
|
||||
|
@ -43,18 +43,8 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
#endif
|
||||
#endif
|
||||
if(SettingsHelper::getInstance()->getRender()=="software"){
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
|
||||
#elif (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
|
||||
#endif
|
||||
}
|
||||
QGuiApplication app(argc, argv);
|
||||
// QLoggingCategory::setFilterRules(QStringLiteral("qt.scenegraph.general=true"));
|
||||
// qSetMessagePattern("%{category}: %{message}");
|
||||
QQmlApplicationEngine engine;
|
||||
AppInfo::getInstance()->init(&engine);
|
||||
engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance());
|
||||
engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance());
|
||||
#ifdef FLUENTUI_BUILD_STATIC_LIB
|
||||
|
Reference in New Issue
Block a user