mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Bug fix sidebar state during restore (#526)
* fix side bar state being incorrect during restore * isVisible is invalid during restore state * Make visibleTabCount function consistent with hasVisibleTabs. Add a bit of documentation. --------- Co-authored-by: Syarif Fakhri <fakhri.s@duerr-ndt.com>
This commit is contained in:
parent
27edfe63ee
commit
92da2eb8bd
@ -279,7 +279,7 @@ bool CAutoHideSideBar::eventFilter(QObject *watched, QEvent *event)
|
||||
show();
|
||||
break;
|
||||
|
||||
case QEvent::Hide:
|
||||
case QEvent::HideToParent:
|
||||
if (!hasVisibleTabs())
|
||||
{
|
||||
hide();
|
||||
@ -321,7 +321,7 @@ int CAutoHideSideBar::visibleTabCount() const
|
||||
int count = 0;
|
||||
for (auto i = 0; i < tabCount(); i++)
|
||||
{
|
||||
if (tabAt(i)->isVisible())
|
||||
if (tabAt(i)->isVisibleTo(parentWidget()))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
@ -336,7 +336,7 @@ bool CAutoHideSideBar::hasVisibleTabs() const
|
||||
{
|
||||
for (auto i = 0; i < tabCount(); i++)
|
||||
{
|
||||
if (tabAt(i)->isVisible())
|
||||
if (tabAt(i)->isVisibleTo(parentWidget()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -135,14 +135,14 @@ public:
|
||||
int tabCount() const;
|
||||
|
||||
/**
|
||||
* Returns the number of visible tabs
|
||||
* Returns the number of visible tabs to its parent widget.
|
||||
*/
|
||||
int visibleTabCount() const;
|
||||
|
||||
/**
|
||||
* Returns true, if the sidebar contains visible tabs.
|
||||
* Returns true, if the sidebar contains visible tabs to its parent widget.
|
||||
* The function returns as soon as it finds the first visible tab.
|
||||
* That means, if you just want to find out if theee are visible tabs
|
||||
* That means, if you just want to find out if there are visible tabs
|
||||
* then this function is quicker than visibleTabCount()
|
||||
*/
|
||||
bool hasVisibleTabs() const;
|
||||
|
Loading…
Reference in New Issue
Block a user