本文整理汇总了C++中ArchivePtr::findSubArchive方法的典型用法代码示例。如果您正苦于以下问题:C++ ArchivePtr::findSubArchive方法的具体用法?C++ ArchivePtr::findSubArchive怎么用?C++ ArchivePtr::findSubArchive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArchivePtr
的用法示例。
在下文中一共展示了ArchivePtr::findSubArchive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreAllViewAreaLayouts
void ViewArea::restoreAllViewAreaLayouts(ArchivePtr archive)
{
ViewAreaImpl* mainViewAreaImpl = MainWindow::instance()->viewArea()->impl;
if(archive){
Listing& layouts = *archive->findListing("viewAreas");
if(!layouts.isValid()){
// for the compatibility with the older (1.4 or earlier) versions
Archive* layoutOfViews = archive->findSubArchive("layoutOfViews");
if(layoutOfViews->isValid()){
layoutOfViews->inheritSharedInfoFrom(*archive);
mainViewAreaImpl->restoreLayout(layoutOfViews);
}
} else {
QDesktopWidget* desktop = QApplication::desktop();
const int numScreens = desktop->screenCount();
for(int i=0; i < layouts.size(); ++i){
Mapping& layout = *layouts[i].toMapping();
Archive* contents = dynamic_cast<Archive*>(layout.get("contents").toMapping());
if(contents){
contents->inheritSharedInfoFrom(*archive);
const string type = layout.get("type").toString();
if(type == "embedded"){
mainViewAreaImpl->restoreLayout(contents);
mainViewAreaImpl->self->setViewTabsVisible(layout.get("tabs", mainViewAreaImpl->viewTabsVisible));
} else if(type == "independent"){
ViewArea* viewWindow = new ViewArea();
viewWindow->impl->viewTabsVisible = layout.get("tabs", true);
viewWindow->impl->restoreLayout(contents);
if(viewWindow->impl->numViews == 0){
delete viewWindow;
} else {
const Listing& geo = *layout.findListing("geometry");
if(geo.isValid() && geo.size() == 4){
// -1 means the primary screen
int screen = -1;
if(layout.read("screen", screen)){
if(screen >= numScreens){
screen = -1;
}
}
const QRect s = desktop->screenGeometry(screen);
const QRect r(geo[0].toInt(), geo[1].toInt(), geo[2].toInt(), geo[3].toInt());
viewWindow->setGeometry(r.translated(s.x(), s.y()));
}
if(layout.get("fullScreen", false)){
layout.read("maximized", viewWindow->impl->isMaximizedBeforeFullScreen);
viewWindow->showFullScreen();
} else {
if(layout.get("maximized"), false){
viewWindow->showMaximized();
} else {
viewWindow->show();
}
}
}
}
}
}
}
}
if(isBeforeDoingInitialLayout){
mainViewAreaImpl->resetLayout();
}
}