MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / collapseAll

Method collapseAll

src/document/UBDocumentController.cpp:4045–4066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4043}
4044
4045void UBDocumentController::collapseAll()
4046{
4047 //disable the animations because the view port will be in a invalid state
4048 mDocumentUI->documentTreeView->setAnimated(false);
4049
4050 mDocumentUI->documentTreeView->collapseAll();
4051
4052 QPersistentModelIndex untiltedDocumentIndex = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->untitledDocumentsIndex();
4053 QPersistentModelIndex myDocumentIndex = UBPersistenceManager::persistenceManager()->mDocumentTreeStructureModel->myDocumentsIndex();
4054
4055 UBSortFilterProxyModel *proxy = dynamic_cast<UBSortFilterProxyModel*>(mDocumentUI->documentTreeView->model());
4056
4057 if(proxy){
4058 mDocumentUI->documentTreeView->setExpanded(proxy->mapFromSource(myDocumentIndex), true);
4059 mDocumentUI->documentTreeView->setExpanded(proxy->mapFromSource(untiltedDocumentIndex), true);
4060 }else{
4061 mDocumentUI->documentTreeView->setExpanded(myDocumentIndex, true);
4062 mDocumentUI->documentTreeView->setExpanded(untiltedDocumentIndex, true);
4063 }
4064
4065 mDocumentUI->documentTreeView->setAnimated(true);
4066}
4067
4068//N/C - NNE - 20140513
4069void UBDocumentController::expandAll()

Callers 1

Calls 4

myDocumentsIndexMethod · 0.80
modelMethod · 0.80
mapFromSourceMethod · 0.80

Tested by

no test coverage detected