diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-03 13:54:19 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-03 16:18:27 +0000 |
commit | dbb013d98429f9eed399392da979e42759875db3 (patch) | |
tree | 3a75500294137caadea20aa5fdcfa976fb3ae3b4 /src | |
parent | ad0bc42d00c28593237339081a029ce820da0259 (diff) |
QDockAreaLayoutInfo::updateTabBar(): Save and restore current index.
When rebuilding the tab bar after hiding several dock widgets,
the index gets offset.
Task-number: QTBUG-49045
Change-Id: I05f6a976ca1d8c6f7cdf6532f1a728483398eabc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/widgets/qdockarealayout.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 0a00086138..06c20adb9d 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2105,6 +2105,8 @@ bool QDockAreaLayoutInfo::updateTabBar() const const QSignalBlocker blocker(tabBar); bool gap = false; + const quintptr oldCurrentId = currentTabId(); + int tab_idx = 0; for (int i = 0; i < item_list.count(); ++i) { const QDockAreaLayoutItem &item = item_list.at(i); @@ -2153,6 +2155,9 @@ bool QDockAreaLayoutInfo::updateTabBar() const tabBar->removeTab(tab_idx); } + if (oldCurrentId > 0 && currentTabId() != oldCurrentId) + that->setCurrentTabId(oldCurrentId); + //returns if the tabbar is visible or not return ( (gap ? 1 : 0) + tabBar->count()) > 1; } |