From e5c4096817c91632be66c3df04b157698fef3032 Mon Sep 17 00:00:00 2001 From: Pieter Dewachter Date: Tue, 10 Dec 2024 09:29:30 +0100 Subject: [PATCH] Fix Linux compilation, a potential temporary variable was used after its destruction --- lib/src/style/EventFilters.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/style/EventFilters.cpp b/lib/src/style/EventFilters.cpp index e904bc3..6cdb62c 100644 --- a/lib/src/style/EventFilters.cpp +++ b/lib/src/style/EventFilters.cpp @@ -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);