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:
parent
b2d3d6365e
commit
b5a4be09aa
@ -2096,7 +2096,7 @@ bool QDockAreaLayoutInfo::updateTabBar() const
|
|||||||
that->tabBar->setDrawBase(true);
|
that->tabBar->setDrawBase(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool blocked = tabBar->blockSignals(true);
|
const QSignalBlocker blocker(tabBar);
|
||||||
bool gap = false;
|
bool gap = false;
|
||||||
|
|
||||||
int tab_idx = 0;
|
int tab_idx = 0;
|
||||||
@ -2147,8 +2147,6 @@ bool QDockAreaLayoutInfo::updateTabBar() const
|
|||||||
tabBar->removeTab(tab_idx);
|
tabBar->removeTab(tab_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
tabBar->blockSignals(blocked);
|
|
||||||
|
|
||||||
//returns if the tabbar is visible or not
|
//returns if the tabbar is visible or not
|
||||||
return ( (gap ? 1 : 0) + tabBar->count()) > 1;
|
return ( (gap ? 1 : 0) + tabBar->count()) > 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user