void MyTabbedStackWidget::showWidget(int index) { if (m_stackWidget->currentIndex() == index) { return; } bool proceed = false; emit currentAboutToShow(index, &proceed); if (proceed) { m_stackWidget->setCurrentIndex(index); emit currentChanged(index); } else { m_listWidget->setCurrentRow(m_stackWidget->currentIndex(), QItemSelectionModel::ClearAndSelect); } }
void FancyTabWidget::showWidget(int index) { emit currentAboutToShow(index); m_modesStack->setCurrentIndex(index); emit currentChanged(index); }