From 804ed5115d50485fbe39709fb13eeead45713b30 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 6 Oct 2020 18:20:34 +0200 Subject: [PATCH] Gui: [skip ci] fix appearance of TaskGroups when a style sheet is set --- src/Gui/Application.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 21990b4cf2..36cdda7cf5 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -2345,8 +2345,14 @@ void Application::setStyleSheet(const QString& qssFile, bool tiledBackground) #endif } - if (mdi->style()) - mdi->style()->unpolish(qApp); + // At startup time unpolish() mustn't be executed because otherwise the QSint widget + // appear incorrect due to an outdated cache. + // See https://doc.qt.io/qt-5/qstyle.html#unpolish-1 + // See https://forum.freecadweb.org/viewtopic.php?f=17&t=50783 + if (d->startingUp == false) { + if (mdi->style()) + mdi->style()->unpolish(qApp); + } } void Application::checkForPreviousCrashes()