| 542 | } |
| 543 | |
| 544 | void |
| 545 | DockablePanel::setPagesOrder(const std::list<KnobPageGuiPtr>& orderedPages, |
| 546 | const KnobPageGuiPtr& curPage, |
| 547 | bool restorePageIndex) |
| 548 | { |
| 549 | _imp->_tabWidget->clear(); |
| 550 | |
| 551 | |
| 552 | int index = 0; |
| 553 | int i = 0; |
| 554 | for (std::list<KnobPageGuiPtr>::const_iterator it = orderedPages.begin(); it != orderedPages.end(); ++it, ++i) { |
| 555 | QString tabName = QString::fromUtf8( (*it)->pageKnob.lock()->getLabel().c_str() ); |
| 556 | _imp->_tabWidget->addTab( (*it)->tab, tabName ); |
| 557 | if ( restorePageIndex && (*it == curPage) ) { |
| 558 | index = i; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | if ( (index >= 0) && ( index < int( orderedPages.size() ) ) ) { |
| 563 | _imp->_tabWidget->setCurrentIndex(index); |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | void |
| 568 | DockablePanel::onKnobsRecreated() |
no test coverage detected