From b5a4be09aad19f01b5d83f8674ae244f126c3d4f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 25 Oct 2013 19:58:43 +0200 Subject: QDockAreaLayout: use QSignalBlocker This change changes the point where signals are unblocked again in QDockAreaLayoutInfo::updateTabBar() to include the final tabBar->count() call. This should not be a problem, as count() is a const function and thus shouldn't emit any signals. Change-Id: I6f3dc5696a9c31db51fbe4cdee4b9d83ddeaf61f Reviewed-by: Olivier Goffart --- src/widgets/widgets/qdockarealayout.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/widgets/widgets/qdockarealayout.cpp') diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 72a463b30b..8dab6afb81 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2096,7 +2096,7 @@ bool QDockAreaLayoutInfo::updateTabBar() const that->tabBar->setDrawBase(true); } - bool blocked = tabBar->blockSignals(true); + const QSignalBlocker blocker(tabBar); bool gap = false; int tab_idx = 0; @@ -2147,8 +2147,6 @@ bool QDockAreaLayoutInfo::updateTabBar() const tabBar->removeTab(tab_idx); } - tabBar->blockSignals(blocked); - //returns if the tabbar is visible or not return ( (gap ? 1 : 0) + tabBar->count()) > 1; } -- cgit v1.2.3