void TabBar::currentTabChanged(int index) { if (!validIndex(index)) { return; } hideTabPreview(false); showCloseButton(index); hideCloseButton(m_tabWidget->lastTabIndex()); }
void TabBar::currentTabChanged(int index) { if (!validIndex(index)) { return; } // Don't hide close buttons when dragging tabs if (m_dragStartPosition.isNull()) { showCloseButton(index); hideCloseButton(m_tabWidget->lastTabIndex()); ensureVisible(index); } m_tabWidget->currentTabChanged(index); }
void TabBar::currentTabChanged(int index) { if (!validIndex(index)) { return; } // Don't hide close buttons when dragging tabs if (m_dragStartPosition.isNull()) { showCloseButton(index); if (m_lastTab) { hideCloseButton(m_lastTab->tabIndex()); } QTimer::singleShot(100, this, [this]() { ensureVisible(); }); } m_lastTab = webTab(index); m_tabWidget->currentTabChanged(index); }