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 <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2013-10-25 19:58:43 +02:00 committed by The Qt Project
parent b2d3d6365e
commit b5a4be09aa

View File

@ -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;
}