Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary unpolish operation of the style, before polish the new style #12445

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/widget/controlwidgetconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/widget/wcolorpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 0 additions & 6 deletions src/widget/wpushbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/widget/wwidgetgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ void WWidgetGroup::setHighlight(int highlight) {
return;
}
m_highlight = highlight;
style()->unpolish(this);
style()->polish(this);
update();
emit highlightChanged(m_highlight);
Expand Down
Loading