本文整理汇总了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