Added close panel call when currently selected tab is disabled.
[situare] / src / ui / tabbedpanel.cpp
index 15b87da..807409f 100644 (file)
@@ -265,11 +265,14 @@ void TabbedPanel::setTabsEnabled(const QList<int> &tabIndexes, bool enabled)
     QButtonGroup *tabs = m_panelTabBar->tabs();
 
     foreach (int tabIndex, tabIndexes) {
-
         QAbstractButton *tabButton = tabs->button(tabIndex);
 
-        if (tabButton)
+        if (tabButton) {
+            if (tabButton == tabs->checkedButton())
+                closePanel();
+
             tabButton->setEnabled(enabled);
+        }
     }
 }