From f97abd32fab01950ade77361072afba91b27dbff Mon Sep 17 00:00:00 2001 From: Joerg Date: Sun, 17 Dec 2023 13:39:46 +0100 Subject: [PATCH] Remove unnecessary unpolish operation of the style, before polish the new style --- src/widget/controlwidgetconnection.cpp | 3 --- src/widget/wcolorpicker.cpp | 1 - src/widget/wpushbutton.cpp | 6 ------ src/widget/wwidgetgroup.cpp | 1 - 4 files changed, 11 deletions(-) diff --git a/src/widget/controlwidgetconnection.cpp b/src/widget/controlwidgetconnection.cpp index b04a1ca3323..9fbf52a04b9 100644 --- a/src/widget/controlwidgetconnection.cpp +++ b/src/widget/controlwidgetconnection.cpp @@ -178,9 +178,6 @@ void ControlWidgetPropertyConnection::slotControlValueChanged(double v) { m_propertyValue = vParameter; - // According to http://stackoverflow.com/a/3822243 this is the least - // expensive way to restyle just this widget. - pWidget->style()->unpolish(pWidget); pWidget->style()->polish(pWidget); // These calls don't always trigger the repaint, so call it explicitly. diff --git a/src/widget/wcolorpicker.cpp b/src/widget/wcolorpicker.cpp index 6bc3296a320..129d18cdc8a 100644 --- a/src/widget/wcolorpicker.cpp +++ b/src/widget/wcolorpicker.cpp @@ -234,7 +234,6 @@ void WColorPicker::setColorButtonChecked(const mixxx::RgbColor::optional_t& colo pButton->setIcon(QIcon(checked ? ":/images/ic_checkmark.svg" : "")); } // This is needed to re-apply skin styles (e.g. to show/hide a checkmark icon) - pButton->style()->unpolish(pButton); pButton->style()->polish(pButton); } diff --git a/src/widget/wpushbutton.cpp b/src/widget/wpushbutton.cpp index 454c024782b..5da332b5626 100644 --- a/src/widget/wpushbutton.cpp +++ b/src/widget/wpushbutton.cpp @@ -283,12 +283,6 @@ void WPushButton::setPixmapBackground(const PixmapSource& source, void WPushButton::restyleAndRepaint() { emit displayValueChanged(readDisplayValue()); - // According to http://stackoverflow.com/a/3822243 this is the least - // expensive way to restyle just this widget. - // Since we expect button connections to not change at high frequency we - // don't try to detect whether things have changed for WPushButton, we just - // re-render. - style()->unpolish(this); style()->polish(this); // These calls don't always trigger the repaint, so call it explicitly. diff --git a/src/widget/wwidgetgroup.cpp b/src/widget/wwidgetgroup.cpp index a2385834f31..497be95fa29 100644 --- a/src/widget/wwidgetgroup.cpp +++ b/src/widget/wwidgetgroup.cpp @@ -236,7 +236,6 @@ void WWidgetGroup::setHighlight(int highlight) { return; } m_highlight = highlight; - style()->unpolish(this); style()->polish(this); update(); emit highlightChanged(m_highlight);