mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +08:00
Avoid multiple function calls of parentWidget() function in CAutoHideSideBar::visibleTabCount() and CAutoHideSideBar::hasVisibleTabs()
This commit is contained in:
parent
92da2eb8bd
commit
85f65b3f1a
@ -319,9 +319,10 @@ int CAutoHideSideBar::tabCount() const
|
|||||||
int CAutoHideSideBar::visibleTabCount() const
|
int CAutoHideSideBar::visibleTabCount() const
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
auto ParentWidget = parentWidget();
|
||||||
for (auto i = 0; i < tabCount(); i++)
|
for (auto i = 0; i < tabCount(); i++)
|
||||||
{
|
{
|
||||||
if (tabAt(i)->isVisibleTo(parentWidget()))
|
if (tabAt(i)->isVisibleTo(ParentWidget))
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -334,9 +335,10 @@ int CAutoHideSideBar::visibleTabCount() const
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
bool CAutoHideSideBar::hasVisibleTabs() const
|
bool CAutoHideSideBar::hasVisibleTabs() const
|
||||||
{
|
{
|
||||||
|
auto ParentWidget = parentWidget();
|
||||||
for (auto i = 0; i < tabCount(); i++)
|
for (auto i = 0; i < tabCount(); i++)
|
||||||
{
|
{
|
||||||
if (tabAt(i)->isVisibleTo(parentWidget()))
|
if (tabAt(i)->isVisibleTo(ParentWidget))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user