mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-01-23 04:14:35 +08:00
update
This commit is contained in:
parent
2d1957afe3
commit
0b0fbe1e64
@ -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{
|
||||
id:dialog_restart
|
||||
title:"友情提示"
|
||||
|
@ -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{
|
||||
id:dialog_restart
|
||||
title:"友情提示"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user