Skip to content

Commit

Permalink
Fix Linux compilation, a potential temporary variable was used after …
Browse files Browse the repository at this point in the history
…its destruction
  • Loading branch information
Pieter-Dewachter committed Dec 10, 2024
1 parent 793a690 commit e5c4096
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/style/EventFilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ bool LineEditButtonEventFilter::eventFilter(QObject* watchedObject, QEvent* evt)
const auto mouse = getMouseState(pressed, hovered, enabled);
const auto& theme = _style ? _style->theme() : Theme{};
const auto rect = _button->rect();
const auto palette = _button->style()->standardPalette();

const auto& bgColor =
_style ? _style->toolButtonBackgroundColor(mouse, ColorRole::Secondary)
: _button->style()->standardPalette().color(getPaletteColorGroup(mouse), QPalette::ColorRole::ButtonText);
: palette.color(getPaletteColorGroup(mouse), QPalette::ColorRole::ButtonText);
const auto& fgColor =
_style ? _style->toolButtonForegroundColor(mouse, ColorRole::Secondary)
: _button->style()->standardPalette().color(getPaletteColorGroup(mouse), QPalette::ColorRole::Button);
: palette.color(getPaletteColorGroup(mouse), QPalette::ColorRole::Button);
const auto animationDuration = _style ? _style->theme().animationDuration : 0;
const auto& currentBgColor = _animManager.animateBackgroundColor(_button, bgColor, animationDuration);
const auto& currentFgColor = _animManager.animateForegroundColor(_button, fgColor, animationDuration);
Expand Down

0 comments on commit e5c4096

Please sign in to comment.