This commit is contained in:
朱子楚\zhuzi 2023-12-28 23:21:30 +08:00
parent 2d1957afe3
commit 0b0fbe1e64
6 changed files with 0 additions and 57 deletions

View File

@ -87,26 +87,6 @@ FluScrollablePage{
} }
} }
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
FluCheckBox{
text:"Software Render"
checked: SettingsHelper.getRender() === "software"
anchors.verticalCenter: parent.verticalCenter
onClicked: {
if(SettingsHelper.getRender() === "software"){
SettingsHelper.saveRender("")
}else{
SettingsHelper.saveRender("software")
}
dialog_restart.open()
}
}
}
FluContentDialog{ FluContentDialog{
id:dialog_restart id:dialog_restart
title:"友情提示" title:"友情提示"

View File

@ -90,26 +90,6 @@ FluScrollablePage{
} }
} }
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
FluCheckBox{
text:"Software Render"
checked: SettingsHelper.getRender() === "software"
anchors.verticalCenter: parent.verticalCenter
onClicked: {
if(SettingsHelper.getRender() === "software"){
SettingsHelper.saveRender("")
}else{
SettingsHelper.saveRender("software")
}
dialog_restart.open()
}
}
}
FluContentDialog{ FluContentDialog{
id:dialog_restart id:dialog_restart
title:"友情提示" title:"友情提示"

View File

@ -10,7 +10,3 @@ AppInfo::AppInfo(QObject *parent)
{ {
version(APPLICATION_VERSION); version(APPLICATION_VERSION);
} }
void AppInfo::init(QQmlApplicationEngine *engine){
engine->rootContext();
}

View File

@ -14,7 +14,6 @@ private:
explicit AppInfo(QObject *parent = nullptr); explicit AppInfo(QObject *parent = nullptr);
public: public:
SINGLETONG(AppInfo) SINGLETONG(AppInfo)
void init(QQmlApplicationEngine *engine);
}; };
#endif // APPINFO_H #endif // APPINFO_H

View File

@ -19,8 +19,6 @@ public:
SINGLETONG(SettingsHelper) SINGLETONG(SettingsHelper)
~SettingsHelper() override; ~SettingsHelper() override;
void init(char *argv[]); 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 void saveDarkMode(int darkModel){save("darkMode",darkModel);}
Q_INVOKABLE int getDarkMode(){return get("darkMode",QVariant(0)).toInt();} Q_INVOKABLE int getDarkMode(){return get("darkMode",QVariant(0)).toInt();}
Q_INVOKABLE void saveUseSystemAppBar(bool useSystemAppBar){save("useSystemAppBar",useSystemAppBar);} Q_INVOKABLE void saveUseSystemAppBar(bool useSystemAppBar){save("useSystemAppBar",useSystemAppBar);}

View File

@ -43,18 +43,8 @@ int main(int argc, char *argv[])
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif #endif
#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); QGuiApplication app(argc, argv);
// QLoggingCategory::setFilterRules(QStringLiteral("qt.scenegraph.general=true"));
// qSetMessagePattern("%{category}: %{message}");
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
AppInfo::getInstance()->init(&engine);
engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance()); engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance());
engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance()); engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance());
#ifdef FLUENTUI_BUILD_STATIC_LIB #ifdef FLUENTUI_BUILD_STATIC_LIB