Ejemplo n.º 1
0
void TabBar::currentTabChanged(int index)
{
    if (!validIndex(index)) {
        return;
    }

    hideTabPreview(false);

    showCloseButton(index);
    hideCloseButton(m_tabWidget->lastTabIndex());
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
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);
}