From a8ea6c1eac909148c95ec0c750756d94da1a7c09 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Jun 2024 11:07:54 +0200 Subject: [PATCH] Debugger: Fix action handling of QML Console filter buttons Amends 93a58039561b. Fixes: QTCREATORBUG-30788 Change-Id: I3699e07e67821098500b5b4f85a15d8b19f57ec5 Reviewed-by: Christian Stenger --- src/plugins/debugger/console/console.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index b1ee0dac83e..d7f3cb23343 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -27,6 +27,8 @@ const char SHOW_LOG[] = "showLog"; const char SHOW_WARNING[] = "showWarning"; const char SHOW_ERROR[] = "showError"; +using namespace Utils; + namespace Debugger::Internal { ///////////////////////////////////////////////////////////////////// @@ -90,8 +92,8 @@ Console::Console() m_showDebug.setLabelText(Tr::tr("Show debug, log, and info messages.")); m_showDebug.setToolTip(Tr::tr("Show debug, log, and info messages.")); m_showDebug.setValue(true); - m_showDebug.action()->setIcon(Utils::Icons::INFO_TOOLBAR.icon()); - connect(&m_showDebug, &Utils::BoolAspect::changed, + m_showDebug.setIcon(Icons::INFO_TOOLBAR.icon()); + connect(&m_showDebug, &BoolAspect::changed, proxyModel, [this, proxyModel] { proxyModel->setShowLogs(m_showDebug()); }); m_showDebugButton->setDefaultAction(m_showDebug.action()); @@ -102,8 +104,8 @@ Console::Console() m_showWarning.setLabelText(Tr::tr("Show warning messages.")); m_showWarning.setToolTip(Tr::tr("Show warning messages.")); m_showWarning.setValue(true); - m_showWarning.action()->setIcon(Utils::Icons::WARNING_TOOLBAR.icon()); - connect(m_showWarning.action(), &QAction::toggled, + m_showWarning.setIcon(Icons::WARNING_TOOLBAR.icon()); + connect(&m_showWarning, &BoolAspect::changed, proxyModel, [this, proxyModel] { proxyModel->setShowWarnings(m_showWarning()); }); m_showWarningButton->setDefaultAction(m_showWarning.action()); @@ -114,8 +116,8 @@ Console::Console() m_showError.setLabelText(Tr::tr("Show error messages.")); m_showError.setToolTip(Tr::tr("Show error messages.")); m_showError.setValue(true); - m_showError.action()->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon()); - connect(m_showError.action(), &QAction::toggled, + m_showError.setIcon(Icons::CRITICAL_TOOLBAR.icon()); + connect(&m_showError, &BoolAspect::changed, proxyModel, [this, proxyModel] { proxyModel->setShowErrors(m_showError()); }); m_showErrorButton->setDefaultAction(m_showError.action());