From acacdea43be527042b5ea420c2bbfe4a08714740 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Thu, 20 Jun 2024 22:54:23 +0200 Subject: [PATCH] Gui: Change QStyle only with theme It fiexes performance issues on applying preferences that happens due to forcing Qt style which is quite slow operation. --- src/Gui/PreferencePages/DlgSettingsGeneral.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp index ff940d3d4b..d5467224aa 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp @@ -251,16 +251,17 @@ void DlgSettingsGeneral::saveSettings() int blinkTime{hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0}; qApp->setCursorFlashTime(blinkTime); - std::string qtStyle = hGrp->GetASCII("QtStyle"); - qApp->setStyle(QString::fromStdString(qtStyle)); - saveDockWindowVisibility(); hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow"); hGrp->SetBool("TiledBackground", ui->tiledBackground->isChecked()); - if (themeChanged) + if (themeChanged) { + auto qtStyle = QString::fromStdString(hGrp->GetASCII("QtStyle")); + saveThemes(); + qApp->setStyle(qtStyle); + } } void DlgSettingsGeneral::loadSettings()