当前位置: 首页>>代码示例>>C++>>正文


C++ TabWidget::tabAt方法代码示例

本文整理汇总了C++中TabWidget::tabAt方法的典型用法代码示例。如果您正苦于以下问题:C++ TabWidget::tabAt方法的具体用法?C++ TabWidget::tabAt怎么用?C++ TabWidget::tabAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TabWidget的用法示例。


在下文中一共展示了TabWidget::tabAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: moveTab

void TabWidget::moveTab(QWidget* what,TabWidget *where){
    TabWidget* from = dynamic_cast<TabWidget*>(what->parentWidget());
    
    if(!from){
        return;
    }
    if(from == where){
        /*We check that even if it is the same TabWidget, it really exists.*/
        bool found = false;
        for (int i =0; i < from->count(); ++i) {
            if (what == from->tabAt(i)) {
                found = true;
                break;
            }
        }
        if (found) {
            return;
        }
        //it wasn't found somehow
    }
    
    from->removeTab(what);
    assert(where);
    where->appendTab(what);
    what->setParent(where);
    where->getGui()->getApp()->triggerAutoSave();
}
开发者ID:ndeebook,项目名称:Natron,代码行数:27,代码来源:TabWidget.cpp

示例2:

void
GuiPrivate::notifyGuiClosing()
{
    ///This is to workaround an issue that when destroying a widget it calls the focusOut() handler hence can
    ///cause bad pointer dereference to the Gui object since we're destroying it.
    std::list<TabWidgetI*> tabs = _gui->getApp()->getTabWidgetsSerialization();

    for (std::list<TabWidgetI*>::iterator it = tabs.begin(); it != tabs.end(); ++it) {
        TabWidget* tab = dynamic_cast<TabWidget*>(*it);
        if (!tab) {
            continue;
        }
        tab->discardGuiPointer();
        for (int i = 0; i < tab->count(); ++i) {
            tab->tabAt(i)->notifyGuiClosingPublic();
        }
    }

    const NodesGuiList allNodes = _nodeGraphArea->getAllActiveNodes();


    // we do not need this list anymore, avoid using it
    _gui->getApp()->clearSettingsPanels();



    for (NodesGuiList::const_iterator it = allNodes.begin(); it != allNodes.end(); ++it) {
        DockablePanel* panel = (*it)->getSettingPanel();
        if (panel) {
            panel->onGuiClosing();
        }
    }
    _lastFocusedGraph = 0;
}
开发者ID:kcotugno,项目名称:Natron,代码行数:34,代码来源:GuiPrivate.cpp

示例3: assert

void
Gui::maximize(TabWidget* what)
{
    assert(what);
    if ( what->isFloatingWindowChild() ) {
        return;
    }

    std::list<TabWidgetI*> panes = getApp()->getTabWidgetsSerialization();
    for (std::list<TabWidgetI*>::iterator it = panes.begin(); it != panes.end(); ++it) {
        TabWidget* pane = dynamic_cast<TabWidget*>(*it);
        if (!pane) {
            continue;
        }
        //if the widget is not what we want to maximize and it is not floating , hide it
        if ( (pane != what) && !pane->isFloatingWindowChild() ) {
            // also if we want to maximize the workshop pane, don't hide the properties pane

            bool hasProperties = false;
            for (int i = 0; i < pane->count(); ++i) {
                QString tabName = pane->tabAt(i)->getWidget()->objectName();
                if ( tabName == QString::fromUtf8(kPropertiesBinName) ) {
                    hasProperties = true;
                    break;
                }
            }

            bool hasNodeGraphOrCurveEditor = false;
            for (int i = 0; i < what->count(); ++i) {
                QWidget* tab = what->tabAt(i)->getWidget();
                assert(tab);
                NodeGraph* isGraph = dynamic_cast<NodeGraph*>(tab);
                AnimationModuleEditor* isEditor = dynamic_cast<AnimationModuleEditor*>(tab);
                if (isGraph || isEditor) {
                    hasNodeGraphOrCurveEditor = true;
                    break;
                }
            }

            if (hasProperties && hasNodeGraphOrCurveEditor) {
                continue;
            }
            pane->hide();
        }
    }
    _imp->_toolBox->hide();
}
开发者ID:azerupi,项目名称:Natron,代码行数:47,代码来源:Gui20.cpp


注:本文中的TabWidget::tabAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。