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


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

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


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

示例1: getApp

void
Gui::wipeLayout()
{

    std::list<TabWidgetI*> panesCpy = getApp()->getTabWidgetsSerialization();
    getApp()->clearTabWidgets();
    std::list<SerializableWindow*> floatingWidgets = getApp()->getFloatingWindowsSerialization();

    FloatingWidget* projectFW = _imp->_projectGui->getPanel()->getFloatingWindow();
    for (std::list<SerializableWindow*>::const_iterator it = floatingWidgets.begin(); it != floatingWidgets.end(); ++it) {
        if (!projectFW || (*it) != projectFW) {
            FloatingWidget* isFloating = dynamic_cast<FloatingWidget*>(*it);
            if (isFloating) {
                isFloating->deleteLater();
            }
        }
    }
    getApp()->clearFloatingWindows();

    // Re-add the project window
    if (projectFW) {
        getApp()->registerFloatingWindow(projectFW);
    }



    for (std::list<TabWidgetI*>::iterator it = panesCpy.begin(); it != panesCpy.end(); ++it) {
        TabWidget* pane = dynamic_cast<TabWidget*>(*it);
        if (!pane) {
            continue;
        }
        ///Conserve tabs by removing them from the tab widgets. This way they will not be deleted.
        while ( pane->count() > 0 ) {
            pane->removeTab(0, false);
        }
        //(*it)->setParent(NULL);
        pane->deleteLater();
    }

    std::list<SplitterI*> splittersCpy = getApp()->getSplittersSerialization();
    getApp()->clearSplitters();
    for (std::list<SplitterI*>::iterator it = splittersCpy.begin(); it != splittersCpy.end(); ++it) {
        if (_imp->_leftRightSplitter != *it) {
            Splitter* isSplitter = dynamic_cast<Splitter*>(*it);
            if (!isSplitter) {
                continue;
            }
            while ( isSplitter->count() > 0 ) {
                isSplitter->widget(0)->setParent(NULL);
            }
            //(*it)->setParent(NULL);
            isSplitter->deleteLater();
        }
    }


    Splitter *newSplitter = new Splitter(Qt::Horizontal,this, _imp->_centralWidget);
    newSplitter->addWidget(_imp->_toolBox);
    newSplitter->setObjectName_mt_safe( _imp->_leftRightSplitter->objectName_mt_safe() );
    _imp->_mainLayout->removeWidget(_imp->_leftRightSplitter);
    getApp()->unregisterSplitter(_imp->_leftRightSplitter);
    _imp->_leftRightSplitter->deleteLater();
    _imp->_leftRightSplitter = newSplitter;
    _imp->_leftRightSplitter->setChildrenCollapsible(false);
    _imp->_mainLayout->addWidget(newSplitter);

    getApp()->registerSplitter(newSplitter);

    // Re-create new menu actions
    createMenuActions();
 
} // Gui::wipeLayout
开发者ID:ebrayton,项目名称:Natron,代码行数:72,代码来源:Gui05.cpp


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