Fix tab bar visibility when the execution log tab is enabled

This commit is contained in:
Christophe Dumez
2010-12-25 20:21:04 +00:00
parent 050601498c
commit 64df47b49f
2 changed files with 20 additions and 6 deletions

View File

@@ -36,9 +36,29 @@
class HidableTabWidget : public QTabWidget {
public:
void showTabBar(bool show) {
tabBar()->setVisible(show);
}
protected:
void tabInserted(int index) {
QTabWidget::tabInserted(index);
if(count() == 1) {
showTabBar(false);
} else {
showTabBar(true);
}
}
void tabRemoved(int index) {
QTabWidget::tabInserted(index);
if(count() == 1) {
showTabBar(false);
} else {
showTabBar(true);
}
}
};
#endif // HIDABLETABWIDGET_H