From 56ca042ddc98a43ff4ce8b21c3a9d1304568f486 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 5 Apr 2019 09:31:16 +0200 Subject: [PATCH] Mode selector: Suppress change signals when clicking on active mode tab Change-Id: I027b1a293fb6daafbdd8fee28fa0f477e0be8367 Reviewed-by: hjk --- src/plugins/coreplugin/fancytabwidget.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index 1b7f8703415..0653d8639c9 100644 --- a/src/plugins/coreplugin/fancytabwidget.cpp +++ b/src/plugins/coreplugin/fancytabwidget.cpp @@ -215,11 +215,13 @@ void FancyTabBar::mousePressEvent(QMouseEvent *event) // menu arrow clicked emit menuTriggered(index, event); } else { - emit currentAboutToChange(index); - m_currentIndex = index; - update(); - // update tab bar before showing widget - QTimer::singleShot(0, this, [this]() { emit currentChanged(m_currentIndex); }); + if (index != m_currentIndex) { + emit currentAboutToChange(index); + m_currentIndex = index; + update(); + // update tab bar before showing widget + QTimer::singleShot(0, this, [this]() { emit currentChanged(m_currentIndex); }); + } } } break;