Fix tab auto-hiding to work with Qt < 5.4.

This commit is contained in:
Neel Patel 2016-01-26 10:03:15 +00:00 committed by Dave Page
parent 39e822e846
commit d6d8a2348e
2 changed files with 8 additions and 1 deletions

View File

@ -231,6 +231,12 @@ void BrowserWindow::closetabs()
QPushButton *btn = NULL;
int totalTabs = m_tabWidget->count();
// If QTabWidget contains only one tab then hide the TabBar window
if ((totalTabs - 1) < 2)
m_tabWidget->tabBar()->setVisible(false);
else
m_tabWidget->tabBar()->setVisible(true);
QObject *senderPtr = QObject::sender();
if (senderPtr != NULL)
{
@ -399,6 +405,7 @@ void BrowserWindow::urlLinkClicked(const QUrl &name)
m_addNewGridLayout->addWidget(m_addNewWebView, 0, 0, 1, 1);
m_tabWidget->addTab(m_addNewTab, QString());
m_tabWidget->tabBar()->setVisible(true);
m_tabWidget->setCurrentIndex((m_tabWidget->count() - 1));
// Set the back and forward button on tab

View File

@ -65,7 +65,7 @@ TabWindow::TabWindow(QWidget *parent) :
#endif
// Hide the default tab
tabBar()->setAutoHide(true);
tabBar()->setVisible(false);
}
// Hide the close button of given index displayed on right side of tab