MCPcopy Create free account
hub / github.com/KDE/labplot / setCurrentIndex

Method setCurrentIndex

src/3rdparty/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp:709–730  ·  view source on GitHub ↗

============================================================================

Source from the content-addressed store, hash-verified

707
708//============================================================================
709void CDockAreaWidget::setCurrentIndex(int index)
710{
711 auto TabBar = d->tabBar();
712 if (index < 0 || index > (TabBar->count() - 1))
713 {
714 qWarning() << Q_FUNC_INFO << "Invalid index" << index;
715 return;
716 }
717
718 auto cw = d->ContentsLayout->currentWidget();
719 auto nw = d->ContentsLayout->widget(index);
720 if (cw == nw && !nw->isHidden())
721 {
722 return;
723 }
724
725 Q_EMIT currentChanging(index);
726 TabBar->setCurrentIndex(index);
727 d->ContentsLayout->setCurrentIndex(index);
728 d->ContentsLayout->currentWidget()->show();
729 Q_EMIT currentChanged(index);
730}
731
732
733//============================================================================

Callers 4

Calls 6

currentWidgetMethod · 0.80
showMethod · 0.80
tabBarMethod · 0.45
countMethod · 0.45
widgetMethod · 0.45
isHiddenMethod · 0.45

Tested by

no test coverage detected