From 42af7e4e9f28ac5a1fce75d85c63614e36c2b818 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 11 Apr 2019 14:35:41 +0200 Subject: [PATCH] Avoid the style change crash. This is a temp.workaround until we know how to avoid it, but the usability impact can be neglected Changing the style takes very long anyway and is a bit fault even if it works. --- src/blackgui/components/settingsguicomponent.cpp | 8 ++++++++ src/blackgui/guiapplication.cpp | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/blackgui/components/settingsguicomponent.cpp b/src/blackgui/components/settingsguicomponent.cpp index 6880e0ef3..f85d14a93 100644 --- a/src/blackgui/components/settingsguicomponent.cpp +++ b/src/blackgui/components/settingsguicomponent.cpp @@ -100,10 +100,18 @@ namespace BlackGui const CGeneralGuiSettings settings = m_guiSettings.getThreadLocal(); if (!settings.isDifferentValidWidgetStyle(widgetStyle)) { return; } + /** because of crash (chnage style crashes UI) we require restart const int ret = QMessageBox::information(this, tr("Change style?"), tr("Changing style is slow.\nThe GUI will hang for some seconds.\nDo you want to save your changes?"), QMessageBox::Ok | QMessageBox::Cancel); + + **/ + const int ret = QMessageBox::information(this, + tr("Change style?"), + tr("Changing style requires a restart.\nChanges will be visible a the next start.\nDo you want to save your changes?"), + QMessageBox::Ok | QMessageBox::Cancel); + if (ret != QMessageBox::Ok) { ui->cb_SettingsGuiWidgetStyle->setCurrentText(settings.getWidgetStyle()); diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 56c579a87..490d3d637 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -1095,7 +1095,8 @@ namespace BlackGui { // QStyle *style = QApplication::setStyle(widgetStyle); QStyle *style = QStyleFactory::create(widgetStyle); - QApplication::setStyle(style); // subject of crash + // Disaabled because of crash + // QApplication::setStyle(style); // subject of crash if (style) { CLogMessage(this).info(u"Changed style to '%1', req.: '%2'") << style->objectName() << widgetStyle;